N = int(input())
S = input().rstrip()
index = S.find("#")
answer = 10**9
if index == -1:
    print(0)
    exit()
else:
    answer = S[index:].count(".")
index = S.rfind(".")
if index == -1:
    print(0)
    exit()
else:
    answer = S[:index+1].count("#") if S[:index+1].count("#")<answer else answer
index_s = S.rfind("#")
S_new1 = S[:index_s]
S_new1 = S[:S_new1.rfind(".")+1]
S_new2 = S[index-1:]
res = S_new2.count(".") + S_new1.count("#")
answer = res if res < answer else answer
print(answer)