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

try:
    a = s.index('#')
    s = s[a:]
except:
    pass
ans, black, white = 0, 0, 0
for i in s[::-1]:
    if i == '.':
        white += 1
    elif i == '#' and white > 0:
        black += 1
        
print(min(white, black))
