import sys
import numpy as np

readInt = lambda: int(sys.stdin.readline())
readIntN = lambda: [int(v) for v in sys.stdin.readline().split(' ')]

n = readInt()
s = sys.stdin.readline().strip()

w = 0
wbb = 0
b = 0
for i, c in enumerate(s):
    w += int(c == '.')
    wbb += int(c == '.') if b == 0 else 0
    b += int(c == '#')

ret = min(b, w - wbb)
print(ret)