xxz=input()
hh=xxz.strip()
ddz=1
for i in range (len(hh)):
    if(hh[i]==' ' and (hh[i]!=hh[i+1])):
        ddz=ddz+1
if(ddz>1):
    print(ddz)

b057474552a26ea5714cfc176f122518dcf8334b
<mask token>

<mask token>
for i in range(len(hh)):
    if hh[i] == ' ' and hh[i] != hh[i + 1]:
        ddz = ddz + 1
if ddz > 1:
    print(ddz)

xxz = input()
hh = xxz.strip()
ddz = 1
for i in range(len(hh)):
    if hh[i] == ' ' and hh[i] != hh[i + 1]:
        ddz = ddz + 1
if ddz > 1:
    print(ddz)

xxz=input()
hh=xxz.strip()
ddz=1
for i in range (len(hh)):
    if(hh[i]==' ' and (hh[i]!=hh[i+1])):
        ddz=ddz+1
if(ddz>1):
    print(ddz)
