import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')

N = I()
S = input()

ans1 = INF
idx = S.find('#')
if idx >= 0:
    ans1 = S[idx + 1:].count('.')

ans2 = S[:N - 1].count('#')
print(min(ans1, ans2))
