N = int(input())
S = input()
#print(N)
#print(S)

#print(S[0:])
X = 0
for i in range(N):
    if (S[i] == "#"):
        X = i
        break

#print(S[X:])
print(min(S[X:].count("#"), S[X:].count(".")))