#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long MOD = 1e9 + 7;
int main() {
  int n;
  string s1, s2;
  cin >> n >> s1;
  s2 = s1;
  int ans1 = 0;
  for (long long i = 0; i < (n - 1); i++) {
    if (s1[i] == '#' && s1[i + 1] == '.') {
      ans1++;
      s1[i + 1] = '#';
    }
  }
  int ans2 = 0;
  for (long long i = 0; i < (n - 1); i++) {
    if (s2[i] == '#' && s2[i + 1] == '.') ans2++;
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
