#include<stdio.h> int main(){int b=0; while(1){char a; scanf("%c",&a); b++; if(a==' ')b--; if(a=='\n'){b--;break;} } printf("%d",b); return 0; }