n = int(input())
s = input()
count1 = 0
count2 = 0
m = -1
t = n
for x in range(n):
	if s[x] == "#":
		m = x
		break
if m != -1:
	for u in range(m,n):
	    if s[u] == ".":
		    count1 += 1
		else:
			count2 += 1
	while s[t] == "#":
		count2 -= 1
		t = t-1
print(min(count1,count2))