# -*- coding: utf-8 -*-

#N = int(input())
S = input()

wc = S.count('.')
bc = 0
ans = wc + bc
for s in S:
    if s == '.':
        wc -= 1
    else:
        bc += 1
    temp = wc + bc
    ans = min(temp, ans)
        
print(ans)