n = int(input())
s = list(input())

ans1 = 0
ans2 = 0

for i in range(len(s)):
    if i != 0 and s[i] == '.' and s[i-1] == '#' :
         ans1 += 1
    elif i != len(s)-1 and s[i] == '#' and s[i+1] == '.':
        ans2 += 1

if ans1 < ans2:
    print(ans1)   
else:
    print(ans2)
