n = int(input())
s = input()
b = 0
w = 0

for i in range(n):
    if(s[i] == "#"):
        for j in range(i, n):
            if(s[j] == "#"):
                b += 1
            else:
                w += 1
        if(s[i] == "."):
            w -= 1
        break

if(b > w):
    print(w)
else:
    print(b)