#include <bits/stdc++.h>
using namespace std;
inline void init() {
  int n, white = 0, black = 0, temp = 0;
  char tmp;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> tmp;
    switch (tmp) {
      case '.':
        black += temp;
        temp = 0;
        ++white;
        break;
      default:
        ++temp;
    }
  }
  cout << min(white, black);
}
inline void solve() { cout << '\n'; }
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  init();
  solve();
  return 0;
}
