N = int(input())
S = input()

result = min(S.count("."),S.count("#"))

for i in range(N):
    leftslice = S[:i]
    rightslice = S[i:]
    leftblack = leftslice.count("#")
    rightwhite = rightslice.count(".")
    if result >= leftblack + rightwhite:
        result = leftblack + rightwhite

print(result)