#include <bits/stdc++.h>
using namespace std;

int N;
string S;

int main() {
  cin >> N >> S;
  
  int x = 0;
  for (int i = 0; i < N; i++) {
    if(S[i] == '.') x++;
  }

  int min = x;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      x--;
      if (min > x) min = x;
    }
    else x++;
  }
  cout << min << endl;
}
