a = int(input())
s = list(input())
ans2 = s.count('#')
ans3 = s.count('.')
ans = 0
for i in range(a-1):
    if(s[i] == "#" and s[i+1] == "."):
        ans += 1
        s[i+1] = "#"
        
print(min(ans2, ans, ans3))