import sys,math,collections,itertools
input = sys.stdin.readline

N = int(input())
s = input().rstrip()
sr = s[::-1]

#'.'より左にある#を探す
if '.' not in sr:
    ans = 0
else:
    c = sr.index('.')
    cc = sr[c:].count('.')
    cs = sr[c:].count('#')
    ans = min(cc,cs)
print(ans)
