str = input() list = [] i = 0 s = 0 while i < len(str): s = i while str[i] !=" " and str [i] not in[".",","]: i += 1 if i == len(str): break list.append(str[s:i]) if i == len(str): break while str[i] ==" " or str[i] in [".",","]: i += 1 if i == len(str): break print(len(list[-1]))