import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.PriorityQueue; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final char[] cs = sc.next().toCharArray(); int answer = 0; for(final char c : cs){ answer += 2; switch(c){ case '8': answer++; case '0': case '4': case '6': case '9': answer++; } } System.out.println(answer + 1); } }