# -*- 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 == "#" and not i == N-1:
			count+=1

count2=N-count
print(min([count,count2]))

