n=int(input())
s = input()
l = 0
r = 0
for i in range(n):
    if s[i] == "#":
        l += 1
    else:
        r += 1
ans = 0
for i in range(n-1):
    if s[i: i + 2] == "#.":
        ans += 1
ans = min(ans,min(l, r))
print(ans)
