#include <bits/stdc++.h>
using namespace std;
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;
}
const long long mod = 1e9 + 7;
const long long INF = 1LL << 60;
const long long m = 1LL << 32;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long st = 0;
  for (long long i = 0; i < (n); i++) {
    if (s[i] == '#') {
      st = i;
      break;
    }
  }
  long long b = 0, w = 0;
  for (long long i = st; i < (n); i++) {
    if (s[i] == '#')
      b++;
    else
      w++;
  }
  cout << min(b, w) << endl;
  return 0;
}
