n = int(input())
S = input()
s = list(S)
j = list(S)
ans = 0
aans = 0
for i in range(n-2,-1,-1):
    print(s[i])
    if s[i] == "#" and s[i+1] == ".":
        ans += 1
        s[i+1] = "#"
for i in range(n-1):
    if j[i] == "#" and j[i+1] == ".":
        aans += 1
        j[i+1] == "#"
print(min(ans,aans))