#include <bits/stdc++.h>
using namespace std;
void YES(bool flag) { cout << (flag ? "YES" : "NO") << endl; }
void Yes(bool flag) { cout << (flag ? "Yes" : "No") << endl; }
void yes(bool flag) { cout << (flag ? "yes" : "no") << endl; }
const int INF = 1e7;
const long long MOD = 1e9 + 7;
int main() {
  int n;
  string s;
  cin >> n >> s;
  string t1(s), t2(s);
  int a1 = 0, a2 = 0;
  for (int i = 0; i < n - 1; i++) {
    if (t1[i] == '#' && t1[i + 1] == '.') {
      t1[i + 1] = '#';
      a1++;
    }
  }
  for (int i = n - 1 - 1; i >= 0; i--) {
    if (t2[i] == '#' && t2[i + 1] == '.') {
      t2[i] = '.';
      a2++;
    }
  }
  cout << min(a1, a2) << endl;
  return 0;
}
