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

sdot = ['']
ssphas = s.split('.')
sspdot = s.split('#')
num = min(s.count('.'),s.count('#') - len(ssphas[-1]))
if s[0] == '.':
    sdot.extend(ssphas)
for i in range(len(ssphas)):
    num = min(len(''.join(ssphas[0:i + 1]) + ''.join(sspdot[i + 1:-1])),num)
print(num)