#include <bits/stdc++.h>
using namespace std;
const long long INF = 1ll << 60;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N >> S;
  bool flag_black = false;
  int rsl = 0;
  for (int i = (int)0; i < (int)N; i++) {
    if (!flag_black and S[i] == '#')
      flag_black = true;
    else if (flag_black and S[i] == '.') {
      flag_black = false;
      rsl++;
    }
  }
  cout << rsl << endl;
}
