import java.util.Scanner; class no671{ public static void main(String[] args) { Scanner stdIn=new Scanner(System.in); long n=stdIn.nextLong(); int i=0; while(n!=0) { n=n/10; i++; } int ans; if(i==10) ans=0; else if(i>10) ans=i-10; else ans=10-i; System.out.println(ans); } }