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