#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  int white = 0, black = 0;
  bool flag = false;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ans++;
    } else if (s[i] == '#' && s[i + 1] == '#') {
      flag = true;
    }
    if (s[i] == '#')
      black++;
    else if (s[i] == '.')
      white++;
  }
  if (s[n - 1] == '#')
    black++;
  else if (s[n - 1] == '.')
    white++;
  int ans2 = min(black, white);
  cout << (flag ? max(ans, ans2) : min(ans, ans2)) << endl;
  return 0;
}
