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