#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  int counter = 0;
  int sharp = 0;
  int dot = 0;
  cin >> n >> s;
  try {
    for (int i = 0; i < n; i++) {
      if (s.at(i) == '#') {
        sharp++;
      } else {
        dot++;
      }
    }
    for (int i = 1; i <= n - 1; i++) {
      if (sharp > dot) {
        if (s.at(i - 1) == '#' && s.at(i) == '.') {
          counter++;
          s.at(i) = '#';
        }
      } else {
        if (s.at(i - 1) == '#' && s.at(i) == '.') {
          counter++;
        }
      }
    }
    cout << counter;
  } catch (...) {
    cout << 0 << endl;
  }
}
