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('#')
s = S[i:]

p(s)
p(s.count('.'))
p(s.count('#'))

ans = min(s.count('.'), S.count('#'))
print(ans)


