#include int main(void) { int c[]={1,0,0,0,1,0,1,0,2,1}; int n, r, hall; while(scanf("%d", &n)==1) { r=0; hall=0; do { hall+=c[n%10]; r++; n/=10; } while(n>0); if(hall) printf("%d\n", r*2+hall+1); else printf("%d\n", r+2); } return 0; }