n = int(input())
s = input()
a = 0
b = 0
for i in range(0,n) :
    if s[i] == '.' :
        continue
    elif s[i] == '#' :
        a = i
        break
s = s[a:n]
for j in range(1,n-a+1) :
    if s[-j] == '.' :
        b = j
        break
    elif s[-j] == '#' :
        continue
s = s[0:n-a-b+1]
x = s.count('#')
y = s.count('.')
print(min(x,y))