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