package work; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.Scanner; public class Work { public static void main(String[] args) { try { FileReader in = new FileReader( "input.txt"); BufferedReader bin = new BufferedReader(in); Scanner s = new Scanner(bin); long sum=0; while (s.hasNextLong()) sum+=s.nextLong(); System.out.println(sum); } catch (IOException e) {} } }