# -*- coding: utf-8 -*-

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

s_list = list(s)
b_list = []
a_list = []

cnt_d= 0
cnt_s = 0
cnt_min = 2*10**5
for i in range(n-1):
    if s_list[i] == '#' and s_list[i+1] == '.':
        b_list = s_list[:i+1]
        cnt_s = b_list.count('#')
        a_list = s_list[i+2:]
        cnt_d = a_list.count('.')
        cnt_min = min(cnt_min, cnt_s+cnt_d)
if cnt_min == 2*10**5:
    cnt_min = 0

print(cnt_min)