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

count = 0
ans = 99999999999
revcount = 0
# for i in range(N-1,-1,-1):
#     if S[i] == ".":
#         count+=1
#         #revcount = 0
#     else:
#         revcount+=1
#         ans+=count
#         count=0
for i in range(N-1,-1,-1):
    p =S[0:i].count("#") +S [i:].count(".")
    ans = min(p,ans)
#print(revcount,ans,N-p)
#print(min(revcount,ans,S[:N-p].count("#")))
print(ans)