#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 9;
int main() {
  int n;
  string second;
  cin >> n;
  cin >> second;
  int cnt = 0;
  int cnt2 = 0;
  string p = second;
  for (int i = 1; i < second.size(); i++) {
    if (second[i] == '#' && second[i - 1] == '.' && second[i + 1] == '.') {
      second[i] = '.';
      cnt++;
    } else if (second[i] == '.' && second[i - 1] == '#' && i + 1 < n &&
               second[i + 1] == '#') {
      second[i] = '#';
      cnt++;
    } else if (second[i] == '.' && second[i - 1] == '#') {
      second[i] = '#';
      cnt++;
    }
  }
  cout << cnt;
}
