N = int(input())
S = input()
whites = S.count('.')
stones = [0, whites]
ans = 1000000
for char in S:
    if ans > sum(stones):
        ans = sum(stones)
    if char == '.':
        stones[1] -= 1
    else:
        stones[0] += 1
print(ans)
