public class Solution { public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int sum = 0; boolean isExit = false; while(true) { String s = reader.readLine(); if(s.equals("sum")) { System.out.println(sum); return; } } } }