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

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

while i < N:
    leftslice = S[:i]
    rightslice = S[i:]
    leftblack = leftslice.count("#")
    rightwhite = rightslice.count(".")
    nowresult = leftblack + rightwhite
    if result >= nowresult:
        result = nowresult
    else:
        i += (nowresult - result)
    i += 1

print(result)