#C - Stones
n = int(input())
s = list(input())
isFound = False
cnt = 0
#一番右の白を見つける
for i in range(n):
    if s[i] == '.':
        right = i

#rightまでの黒を数える
for i in range(right):
    if s[i] == '#':
        cnt += 1
        
print(min(s.count('.'), s.count('#'), cnt))