N = int(input())
S = input()
ans = N
pos = 0
S = [S[n] == '#' for n in range(N)]
for index in range(N):
    ans = min(sum(S[0:index])+(N -index -sum(S[index:N])), ans)

    # print(index, sum(S[0:index]),(N -index -sum(S[index:N])))
print(ans)
