#include <bits/stdc++.h>
const int MOD = 1000000007;
using namespace std;
template <class T>
void load(vector<T> &v, int n) {
  for (int i = 0; i < n; ++i) {
    T t;
    cin >> t;
    v.push_back(t);
  }
}
template <class T>
T max(vector<T> &v) {
  return *max_element(v.begin(), v.end());
}
template <class T>
T min(vector<T> &v) {
  return *min_element(v.begin(), v.end());
}
void py(bool isUpper = false) {
  if (isUpper) {
    cout << ("YES") << endl;
  } else {
    cout << ("Yes") << endl;
  }
}
void pn(bool isUpper = false) {
  if (isUpper) {
    cout << ("NO") << endl;
  } else {
    cout << ("No") << endl;
  }
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  char prev;
  int c = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (i == 0) {
      prev = s[i];
    } else {
      if (prev == '#' && s[i] == '.') {
        c++;
      }
    }
  }
  cout << (c) << endl;
}
