N = int(input())
S = input()

white = len([char for char in S if char == '.'])

result = 0
if white == 0:
    result = 0
else:
    result = 10 ** 6
    left_black = 0
    right_white = white
    for char in S:
        if char == '.':
            right_white -= 1
        else:
            left_black += 1
        result = min(result, right_white + left_black)
print(result)
