N = int(input())
S = input()
ans=2*10**5

if S.count("#") == 0 or S.count(".") == 0:
    print(0)

else:
    for i in S:
        a = S[S.find("#"):].count(".")+S[:S.find("#")].count("#")
        ans = min(a,ans)
    print(ans)
    