package com.codegym.task.task05.task0529;

import java.io.BufferedReader;
import java.io.InputStreamReader;

/*
Console-based piggy bank

*/

public class Solution {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int a = Integer.parseInt(br.readLine());
        int total = 0;
        String s = "sum";
        while(1 == 1){
            total += a;
            a = 0;
            String b = br.readLine();
            if(b == s){
                System.out.println(total); break;
            }
            else {total += Integer.parseInt(b);}
        }
    }
}