# -*- coding: utf-8 -*-
N = int(input())
S = input()
count = []
siro_kuro = 10000000
kuro_siro = 10000000
for i in range(N):
#    print('i: ' + str(i))
    if S[i]=='#':
        kuro_siro = S[0:i].count('#')
#        print(kuro_siro)
        siro_kuro = S[i:N+1].count('.')
#        print(siro_kuro)

    count.append(kuro_siro+siro_kuro)
#    print()

m = min(count)
if m == 20000000: m = 0

print(m)

