#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int r_bs = 0;
  int r_ws = 0;
  int l_bs = 0;
  int l_ws = 0;
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] == '.')
      ++r_ws;
    else
      ++r_bs;
  }
  int count = 2147483647;
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] == '.') {
      ++l_ws;
      --r_ws;
    } else {
      ++l_bs;
      --r_bs;
    }
    count = min(count, r_ws + l_bs);
  }
  cout << count << endl;
  return 0;
}
