import numpy as np
n=int(input())
s=[a for a in input()]
x = []
for a in s:
    if a == '.':
        x.append(0)
    else:
        x.append(1)
s = np.array(x)
ans = np.zeros(n).astype(np.uint8)
cnt = np.sum(s != ans)
for i in range(n):
    ans[-1 * (i+1)] = 1
    _cnt = np.sum(s != ans)
    if cnt > _cnt:
        cnt = _cnt
print(cnt)
