N = int(input())
S = list(input())
# b = S.count("#")
w = S.count(".")
black = 0
white = w
ans = 2e5
for i in range(N):
    if S[i] == "#":
        black += 1
    elif S[i] == ".":
        white -= 1
    # print(black,white)
    ans = min(black + white, ans)
print(ans)