#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s, sub1, sub2;
  cin >> s;
  sub1 = s;
  sub2 = s;
  int res = 0;
  for (int i = 0; i < (n - 1); i++) {
    if (sub1[i] == '#' && sub1[i + 1] == '.') sub1[i + 1] = '#', res++;
  }
  int tmp = 0;
  for (int i = n - 1; i > 0; i--) {
    if (sub2[i] == '.' && sub2[i - 1] == '#') sub2[i - 1] = '.', tmp++;
  }
  cout << min(res, tmp) << endl;
  return 0;
}
