#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pint = pair<int, int>;
using vi = vector<int>;
const int MOD = 1000000007;
const int INF = 1 << 30;
int main() {
  int n;
  string s;
  cin >> n >> s;
  reverse(s.begin(), s.end());
  auto t = s;
  int c1 = 0, c2 = 0;
  for (int i = 0; i < (int)(n - 1); i++) {
    if (s[i] == '.' && s[i + 1] == '#') {
      s[i + 1] = '.';
      c1++;
    }
    if (t[i] == '.' && t[i + 1] == '#') {
      t[i] = '#';
      c2++;
    }
  }
  cout << min(c1, c2) << endl;
  return 0;
}
