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

count_list = []

black = 0
white = s.count('.')

for i in range(n):
    if s[i] == '#':
        black += 1
    if s[i] == '.':
        white -= 1
    count_list.append(black + white)

print(min(count_list))