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


from sys import stdin



############################################


# read data for n sequences.
n = stdin.readline()
N = int(n)
n = stdin.readline()
S = str(n)

#data = [int(stdin.readline().rstrip()) for _ in range(n)]

out=[]
count=0
for i,l in enumerate(S):
	if i < N:	
		if l == "#":
			count += 1

# count black on right
countX=0
for l in reversed(S):
	if l == "#":
		countX+=1
	else:
		break

countY=0
for l in S:
	if l == ".":
		countY+=1
	else:
		break
		
count2 = N-count-countY
count -= countX
print(min([count,count2]))
