import java.util.Scanner; public class No509 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String N = sc.next(); String n[] = N.split(""); int cnt = 1; int x[] = new int[n.length]; for(int i = 0;i < n.length;i++) { x[i] = Integer.parseInt(n[i]); } for(int i = 0;i < n.length;i++) { switch(x[i]) { case 1: case 2: case 3: case 5: case 7: cnt += 2; break; case 0: case 4: case 6: case 9: cnt += 3; break; case 8: cnt += 4; } } System.out.println(cnt); } }