Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.io.*;
- import java.math.*;
- /**
- * Auto-generated code below aims at helping you parse
- * the standard input according to the problem statement.
- **/
- class Solution {
- public static void main(String args[]) {
- Scanner in = new Scanner(System.in);
- String s = in.nextLine();
- s = s.replaceAll("[^0-9]","");
- int[] tab = {1,0,0,0,0,0,1,0,2,1};
- int sum = 0;
- for(char c : s.toCharArray())
- sum += tab[c-'0'];
- System.out.println(sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement