n = int(input())
s = input()
h = 0
t = len(s)
while h < t and s[h] == '.':
    h += 1
while h<t and s[t-1] == '#':
    t -= 1
if t==h:
    print(0)
    exit()
s = s[h:t]
print(min(s.count('.'), s.count('#')))
