#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main(int argc, char const* argv[]) {
  int n, cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < (n); i++) {
    if (s[i] == '.')
      cnt1++;
    else
      cnt2++;
  }
  for (int i = 0; i < (n); i++) {
    if (s[i] == '.') {
      for (int j = i + 1; j < n; j++) {
        if (s[j] == '.') cnt3++;
      }
      break;
    }
  }
  cout << min(cnt1, min(cnt2, cnt3)) << endl;
  return 0;
}
