#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char s[n];
  char s2[n];
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++) s2[i] = s[i];
  int ans = 0;
  int ans2 = 0;
  if (s[0] == '#') {
    s[0] = '.';
    s2[0] = '.';
    ans++;
    ans2++;
  }
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      s[i + 1] = '#';
      ans++;
    }
  }
  for (int i = 0; i < n - 1; i++) {
    if (s2[i] == '.' && s2[i + 1] == '#') {
      s2[i + 1] = '.';
      ans2++;
    }
  }
  if (ans < ans2)
    cout << ans << endl;
  else
    cout << ans2 << endl;
  return 0;
}
