#include <bits/stdc++.h>
using namespace std;
const int base = 1000000007;
int main() {
  long long int n;
  string ss;
  cin >> n >> ss;
  string s = ss, fs = ss;
  int r = 0, l = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') s[i + 1] = '#', r++, i--;
  }
  for (int i = n - 1; i >= 1; i--) {
    if (fs[i] == '.' && fs[i - 1] == '#') fs[i - 1] = '.', l++, i++;
  }
  cout << min(r, l);
}
