#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 58;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
void remove(T &vector, unsigned int index) {
  vector.erase(vector.begin() + index);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N >> S;
  int ans = 0;
  for (int i = 0; i < (int)(N - 1); i++) {
    if (S[i] == '#' and S[i + 1] == '.') ans++;
  }
  cout << ans << endl;
  return 0;
}
