N = int(input())
S = input()
 
res = 0
tmp = ""

for i in range(N-1,-1,-1):
    if S[i] == "#":
        continue
    dot = S[:i+1].count(".")
    sha = S[:i+1].count("#")
    break
print(min(dot, sha))