ans = 0
for i in range(len(S) - 1):
    if S[i] == '#' and S[i+1] == '.':
        ans += 1
if S.count('.') > S.count('#'):
    ans_c = S.count('#')
else:
    ans_c = S.count('.')
if ans < ans_c:
    print(ans)
else:
    print(ans_c)
    