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