#include <bits/stdc++.h>
using namespace std;
using vl = vector<long long int>;
using vvl = vector<vector<long long int>>;
using vs = vector<string>;
using vvs = vector<vector<string>>;
template <typename T>
void print(T v) {
  for (size_t i = 0; i < v.size(); i++) {
    cout << i << ": " << v[i] << endl;
  }
}
template <typename T>
void print2(T v) {
  for (size_t i = 0; i < v.size(); i++) {
    cout << i << ": ";
    for (size_t j = 0; j < v[0].size(); j++) {
      cout << v[i][j] << " ";
    }
    cout << endl;
  }
}
template <typename T>
T slice(T v, long long int left, long long int right) {
  T ret(0);
  copy(v.begin() + left, v.begin() + right, back_inserter(ret));
  return ret;
}
int main() {
  long long int N;
  string S;
  cin >> N >> S;
  long long int ans = 0;
  if (S[0] == '#' && S[1] == '.') {
    ans += 1;
  }
  for (long long int i = 1; i < N - 2; i++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      ans += 1;
      if (S[i - 1] == '#' && S[i + 1] == '#') {
        S[i + 1] = '#';
      }
    }
  }
  if (S[N - 2] == '#' && S[N - 1] == '.') {
    ans += 1;
  }
  cout << ans << endl;
  return 0;
}
