import fractions,math,sys
from collections import Counter
n = int(input())
s = list(input())
min = 10**9
for i in range(n):
    l = s[:i]
    r = s[i:]
    cnt_l = Counter(l)
    cnt_r = Counter(r)
    if cnt_l['#'] + cnt_r['.'] < min:
        min = cnt_l['#'] + cnt_r['.']
print(min)

