#include<bits/stdc++.h>
using  std;
int main()
{
  int i,k,n,m;
  string s;
  cin >> n >> s;
  vector<int> white(n+1);
  vector<int> black(n+1);
  white.at(0)=0;
  black.at(0)=0;
  for(i=0;i<n;i++)
  {
    if(s.at(i)=='#')
    { white.at(i+1)=white.at(i)+1;
    }
    else
    {
      white.at(i+1)=white.at(i);
    }
  }
 for(i=0;i<n;i++)
  {
    if(s.at(n-1-i)=='.')
    {  black.at(i+1)=black.at(i)+1;
    }
   else
    {
      black.at(i+1)=black.at(i);
    }
  } 
  m=1000000;
  for(i=0;i<n+1;i++)
  {
    if(m>=white.at(i)+black.at(n-i))
      m=white.at(i)+black.at(n-i);
  //  cout << m << endl;
  }
  cout << m << endl;
}