N = int(input())
S = input().rstrip()
index = S.find("#")
answer = 0
if index == -1:
    print(0)
    exit()
else:
    answer = S[index:].count(".")
index = S.rfind(".")
answer = S[:index].count("#") if S[:index].count("#")<answer else answer
print(answer)