N = int(input())
S = input().rstrip()
#最後尾の白を見つけその前の黒を白に
answer1 = S[:S.rfind(".")+1].count("#")
#先頭の黒を見つけその後ろの白を黒に
answer2 = S[S.find("#"):].count(".")
answer3 = 10**9
answer4 = 10**9
index = S.rfind(".")
if index == N-1:
    #右黒左白
    S_last = S[S.rfind("#"):index+1]
    S_first = S[:S[:S.rfind("#")].rfind(".")]
    answer3 = S_last.count(".") + S_first.count("#")
index = S.find("#")
if index == 0:
    S_first = S[index:S.find(".")]
    S_last = S[S.find("."):]
    answer4 = S_last.count(".") + S_first.count("#")
    print(answer4)
print(min([answer1, answer2, answer3,answer4]))
