N = int(raw_input())
S = list(raw_input())

all = 0
tmp = 0
for i in S:
    if  i == '.':
        all += 1
ans = all
for i in range(N):
    if S[i] == '.':
        tmp += 1
    ans = min(ans, all - tmp + i + 1 - tmp)

print ans