
n = int(input())
s = input()

ans = n
cnt_w = s.count('.')
cnt_k = 0
if cnt == n or cnt == 0:
    ans = 0
    print(ans)
else:
    for i in range(n):
        if s[i] == '.':
            cnt_w -= 1
        else:
            cnt_k += 1
        if ans > cnt_w + cnt_k:
            ans = cnt_w + cnt_k
    print(ans)
