# -*- coding: utf-8 -*-

# input

N = int(input())
S = input()



for idx, s in enumerate(S):
    if s == "#":
        S = S[idx:]
        break


w_n = S.count(".")
b_n = S.count("#")

if N==w_n or N==b_n:
    print(0)
    exit()

if w_n <=b_n:
    ans = w_n
else:
    ans = b_n



print(ans)