N = int(input())
S = input()
blackcnt = 0
whitecnt = 0
whiteflag = False

for i in range(N):
    if S[i] == '#':
        whiteflag = True
        blackcnt += 1
    elif whiteflag and S[i] == '.':
        whitecnt += 1

print(min(blackcnt, whitecnt) if whiteflag else 0)