#%%
n = int(input())
s = list(input())

a = 0
b = 0
for i in range(n):
    if s[i] == '#':
        a = i
        break
c1 = 0
for i in range(a,n):
    if s[i] == '.':
        c1 += 1

c2 = 0
for i in range(n):
    if s[i] == '.':
        b = i
for i in range(0, b+1):
    if s[i] == '#':
        c2 += 1

ans = min(c1, c2)
print(ans)

