Language: Java

public class Main {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);

		String line = sc.nextLine();
		int count = 0;
		for (int i = 0; i < line.length(); i++) {
			if (line.charAt(i) == '1') {
				count++;
			}
		}
		System.out.println(count);
	}

	static class FastScanner {

		private BufferedReader reader = null;
	    private StringTokenizer tokenizer = null;

	    public FastScanner(InputStream in) {
	        reader = new BufferedReader(new InputStreamReader(in));
	        tokenizer = null;
	    }

	    public String next() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                tokenizer = new StringTokenizer(reader.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }
	        return tokenizer.nextToken();
	    }

	    public String nextLine() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                return reader.readLine();
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }

	        return tokenizer.nextToken("\n");
	    }

	    public long nextLong() {
	        return Long.parseLong(next());
	    }

	    public int nextInt() {
	        return Integer.parseInt(next());
	    }

	    public double nextDouble() {
	         return Double.parseDouble(next());
	     }

	    public int[] nextIntArray(int n) {
	        int[] a = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    public long[] nextLongArray(int n) {
	        long[] a = new long[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextLong();
	        return a;
	    }

	}


}


Compiler output:
Main.java:18: error: cannot find symbol
		private BufferedReader reader = null;
		        ^
  symbol:   class BufferedReader
  location: class FastScanner
Main.java:19: error: cannot find symbol
	    private StringTokenizer tokenizer = null;
	            ^
  symbol:   class StringTokenizer
  location: class FastScanner
Main.java:21: error: cannot find symbol
	    public FastScanner(InputStream in) {
	                       ^
  symbol:   class InputStream
  location: class FastScanner
Main.java:22: error: cannot find symbol
	        reader = new BufferedReader(new InputStreamReader(in));
	                     ^
  symbol:   class BufferedReader
  location: class FastScanner
Main.java:22: error: cannot find symbol
	        reader = new BufferedReader(new InputStreamReader(in));
	                                        ^
  symbol:   class InputStreamReader
  location: class FastScanner
Main.java:29: error: cannot find symbol
	                tokenizer = new StringTokenizer(reader.readLine());
	                                ^
  symbol:   class StringTokenizer
  location: class FastScanner
Main.java:30: error: cannot find symbol
	            } catch (IOException e) {
	                     ^
  symbol:   class IOException
  location: class FastScanner
Main.java:41: error: cannot find symbol
	            } catch (IOException e) {
	                     ^
  symbol:   class IOException
  location: class FastScanner
8 errors