#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, n, k, cnt = 0, ans;
  string s;
  cin >> n >> s;
  for (auto c : s) {
    if (c == '.') cnt++;
  }
  ans = cnt;
  for (auto c : s) {
    if (c == '.')
      cnt--;
    else
      cnt++;
  }
  cout << min(ans, cnt) << endl;
  return 0;
}
