#include <stdio.h>
int
main()
{
char
ch;
int
n = 0;
int
flag = 0;
while
(1)
{
ch =
getchar
();
if
(ch ==
'\n'
){
break
;
}
else
if
(ch !=
' '
)
{
if
(flag == 0){
n = 0;
flag = 1;
}
n++;
}
else
{
flag = 0;
}
}
printf
(
"%d\n"
, n);
return
0;
}