#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001000;
const int mINF = -1001001000;
const long long LINF = 1010010010010010000;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int b = 0, w = 0;
  bool flag = false;
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '#') {
      b++;
      flag = true;
    } else if (s[i] == '.' && flag) {
      w++;
    }
  }
  int ans = min(b, w);
  cout << ans << endl;
  return 0;
}
