#include <iostream>
#include <algorithm>
using namespace std;
 
int main() {
  int n;
  string s;
  cin >> n >> s;
 
  int white = 0;
  for (int i = 0; i < n; i++)
    if (s[i] == '.')
      white++;

  int w = 0; 
  int minChange = white;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      w++;
    int change = (white - w) + i + 1 - w;
    minChange = min(minChange, change);
  }
 
  cout << minChange << endl;
  return 0;
}