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()


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

while i>=0:
	j = S.find('#.',i+1)
	if j==-1: break
	i=j

b = S[:(i+1)]
p(i, b)

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

