n=int(input())

hoge=input()

huga=[]

flag=hoge[0]
kazu=0

for i in range(n):
  if(hoge[i]==flag):
    kazu+=1
  else:
    huga.append(kazu)
    kazu=1
    flag=hoge[i]

huga.append(kazu)

ans=[]
ans.append(hoge.count("."))
ans.append(hoge.count("#"))
base=0

if(hoge[0]=="#"):
  base+=huga[0]
  huga=huga[1:]
if(hoge[-1]=="."):
  base+=huga[-1]
  huga=huga[:len(huga)-1]

  
kuro=[]
siro=[]
flag="w"
for i in range(len(huga)):
  if(flag=="w"):
    siro.append(huga[i])
    flag="b"
  else:
    kuro.append(huga[i])
    flag="w"

siro=siro[1:]
kuro=kuro[:len(kuro)-1]
for i in range(len(siro)+1):
  ans.append(base+sum(siro[:i])+sum(kuro[i:]))
  
print(min(ans))