N = int(input())
S = input()
index = S.find("#")
answer = -1
if(index == -1):
    answer = 0
else:
    test = S[index:N]
    count_s = S.count("#")
    count_d = S.count(".")
    answer = min(count_s,count_d)
print(answer)