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