import java.io.*; import java.util.*; public class Main_yukicoder671 { private static Scanner sc; private static Printer pr; private static void solve() { char[] n = sc.next().toCharArray(); int cnt = 0; for (char c : n) { if (c == '0') { cnt++; } } pr.println(Math.abs(cnt - 8)); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes())); pr = new Printer(System.out); solve(); // pr.close(); pr.flush(); // sc.close(); } static String INPUT = null; private static class Printer extends PrintWriter { Printer(OutputStream out) { super(out); } } }