#include <bits/stdc++.h>
using namespace std;
template <size_t SIZE, class T>
inline size_t array_size(T (&arr)[SIZE]) {
  return SIZE;
}
int main() {
  int N;
  string S;
  cin >> N >> S;
  reverse(S.begin(), S.end());
  int num = 0;
  for (int i = 1; i < S.length(); ++i) {
    if (S[i] == '#' && S[i - 1] == '.') {
      ++num;
    }
  }
  cout << num << endl;
  return 0;
}
