#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
  int n,count = 0, ans = 0;
  char *s;
  scanf("%d",&n);
  s = new char[n+1];
  scanf("%s",s);

  for (int i = 0; i < n ; ++i)
    if (s[i] == '.')
      ++count;
  
  ans = count;
  for (int i = 0 ; i < n ; ++i) {
    if(s[i]=='#') ++count;
    else --count;
    ans = min(ans,count);
  }
  
  printf("%d",ans);
  delete s;
  return 0;
}
