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

min_num = n
white_num_left = 0
black_num_left = 0
white_num = s.count('.')
black_num = n - white_num


for i in range(n):
    if s[i] == '#':
        black_num_left += 1
    else:
        white_num_left += 1
    if min_num >= black_num_left + (white_num - white_num_left):
        min_num = black_num_left + (white_num - white_num_left)
print(min_num)