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

count = 0
if s[n-2] == "." and s[n-1] == "#":
    for i in range(n-1):
        if s[i] != "#":
            count += 1
    ans = min(count, n-1-count)

else:
    for i in range(n):
        if s[i] != "#":
            count += 1
    ans = min(count, n-count)


print(ans)
    
        

