#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long cur = 0;
  for (int i = 0; i < ((int)n); i++) {
    if (s[i] == '#') {
      cur = i;
      break;
    }
  }
  long long b = 0;
  long long w = 0;
  for (long long i = s.size() - 1; i >= cur; i--) {
    if (s[i] == '#')
      b++;
    else
      w++;
  }
  cout << min(b, w) << endl;
}
