N = int(input())
S = list(input())
S = ['0'] + S + ['0']

l_sum = []
r_sum = []
sum_list = []

l_c = 0
r_c = 0

for i in range(len(S)):
	if S[i] == '#':
		l_c = l_c + 1
	l_sum.extend([l_c])
	if S[len(S)-1-i] == '.':
		r_c = r_c + 1
	r_sum.insert(0,r_c)

sum_list = [x + y for (x,y) in zip(l_sum,r_sum)]
print(min(sum_list))
