BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String sNum = reader.readLine();
        int sum = 0;
        while (true) {
            int num = Integer.parseInt(sNum);
            sum += num;
            if (num == -1) {
                break;
            }
        }
        System.out.println(sum);
    }
}