c,s;main(w){for(;read(0,&c,1);w=c-10?w:2)s+=c%w;printf("%d",s);}