#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n >> s;
  string s1 = s, s2 = s;
  int ans1 = 0, ans2 = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s1[i] == '#' && s1[i + 1] == '.') {
      ans1++;
      s1[i + 1] = '#';
    }
    if (s2[i] == '#' && s2[i + 1] == '.') {
      ans2++;
      s2[i] = '.';
    }
  }
  cout << min(ans1, ans2) << endl;
}
