import fractions,math,sys,collections
n = int(input())
s = input()
s = list(s)
cnt_s = cnt_e = collections.Counter(s)
for i in range(n):
    if s[i] == '.':
        cnt_s['.'] -= 1
    else:
        break
for i in range(n)[::-1]:
    if s[i] == '#':
        cnt_e['#'] -= 1
    else:
        break
print(min(cnt_s['.'],cnt_s['#'],cnt_e['.'],cnt_e['#']))


