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

black = len([char for char in S if char == '#'])
white = N - black

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)
