#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  reverse((s).begin(), (s).end());
  int b = 0, w = 0;
  int tw = 0;
  for (int i = 0; i < s.size(); i++) {
    char c = s[i];
    if (c == '#') {
      b++;
      w += tw;
      tw = 0;
    } else {
      tw++;
    }
  }
  cout << min(b, w) << endl;
}
int main() {
  solve();
  return 0;
}
