import sys
def p(*a):
  s=" ".join(map(str,a))
  #print(s)
  sys.stderr.write(s+"\n")


N=int(input())
S=input()
N=len(S)

if (S.count('.')==N) or (S.count('#')==N):
	print(0)
	exit()


#	s = "abc345abc"
#	print(s.find("a"))		#=> 0

i = S.find('#.')
a = S[(i+1):]
b = S[:(i+1)]

p(i, a)
p(i, b)

ans = min(a.count('.'), b.count('#'))
print(ans)


#		l = sorted(s, reverse=True)
#		print(l)						#=> ['y', 't', 'o', 'n', 'h', 'P']
#		print( "".join(l) )				#=> ytonhP
