#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, ct1 = 0, ct2 = 0;
  string s, sc;
  cin >> n >> s;
  sc = s;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ct1++;
      s[i + 1] = '#';
    }
  }
  for (int i = n - 1; i > 0; i--) {
    if (sc[i] == '.' && sc[i - 1] == '#') {
      ct2++;
      sc[i - 1] = '.';
    }
  }
  cout << min(ct1, ct2) << "\n";
}
