import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String [] n = sc.next().split(""); int count = 0; for (int i = 0; i < n.length; i++) { if (n[i].equals("0")) { count ++; } } System.out.println(Math.abs(8 - count)); sc.close(); } }