#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  string ss;
  cin >> N >> ss;
  string s = ss;
  int ans1 = 0, ans2 = 0;
  for (int i = 0; i < (int)(N); i++) {
    if (s[i] == '#' && s[i + 1] == '.' && i + 1 < N) {
      s[i + 1] = '.';
      ans1++;
    }
  }
  s = ss;
  for (int i = (1); i < (N); ++i) {
    if (s[i] == '.' && s[i - 1] == '#') {
      s[i - 1] = '.';
      ans2++;
    }
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
