public class Solution { public static void main(String[] args) throws Exception { Scanner sc1 = new Scanner(System.in); int sum = 0; while(true) { String s = sc1.nextLine(); if (s.equals("sum")) break; } sum += Integer.parseInt(s); } System.out.println(sum); } }