n=int(input())
s=list(input())
li=[]
if s[0]=='.':
  a=0
  s.insert(0,"あ")
  for i in range (1,n+1):
    if s[i]==s[i-1]:
      a=a+1
    else:
      li.append(a)
      a=1
  li.append(a)
else:
  a=1
  for i in range (0,n-1):
    if s[i+1]==s[i]:
      a=a+1
    else:
      li.append(a)
      a=1
  if s[n-2]==s[n-1]:
    a=a+1
    li.append(a)
  else:
    li.append(a)
if s[n-1]==".":
  li.append(0)
len_li=len(li)
import math
t=math.floor(len_li/2)+1
l=[]
m=0
for j in range (0,t-1):
  m=m+li[2*j+1]
x=0
y=0
for k in range (0,t):
  l.append(m+y-x)
  y=y+li[2*k]
  if k!=t-1:
    x=x+li[2*k+1]
l.sort()
print(l[0])