#include<iostream>
#include<string>
	using namespace std;
	int main()
	{
		string line;
		//不要使用cin>>line,因为它遇到空格就结束了
		//while(cin>>line)
		while (getline(cin, line))
		{
			size_t pos = line.rfind(' ');
			cout << line.size() - pos - 1 << endl;
		}

		return 0;
	}

getline函数的作用就是从头到尾遍历字符串
getline(cin >> 需要遍历的字符串)