#include <string.h> #include <stdlib.h> int main() { int n; char s[1000]; int m; gets(s); m=strlen(s); n=0; while(s[n]!=0){ n++;if(s[n]==' '||s[n]=='\n')m--; } printf("%d",m); return 0; }