#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void display_vec(vector<int> v) {
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << endl;
  }
  cout << endl;
}
int main(int argc, const char *argv[]) {
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] == '.' && s[i - 1] == '#') {
      s[i - 1] = '#';
      cnt++;
      i++;
    }
  }
  int min = cnt;
  cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      s[i - 1] = '#';
      cnt++;
      i++;
    }
  }
  if (cnt < min) {
    min = cnt;
  }
  cout << min << endl;
}
