N=int(input())
S=input()
t=[]

def popcnt0(n):
	global N
	c = 0
	for i in range(N):
		c += (n >> i) & 1
	return c

for i in range(len(S)):
	if S[i]=='#':
		t.append('1')
	else:
		t.append('0')
tt=''.join(t)
a=int(tt, 2)
b=popcnt0(0^a)
for i in range(N):
	tmp=((1<<(i+1)) -1) ^ a
	m=popcnt0(tmp)
	if m<b:
		b=m
print(b)



