#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < N - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      s[i + 1] = '#';
      ans++;
    }
  }
  cout << (ans) << endl;
}
