#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void amin(T &first, const T &second) {
  if (second < first) first = second;
}
template <class T>
inline void amax(T &first, const T &second) {
  if (first < second) first = second;
}
template <typename T>
void output(T t) {
  cout << t << "\n";
}
template <typename T, typename U, typename... Args>
void output(T t, U u, Args... args) {
  cout << t << " ";
  output(u, args...);
}
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ret = 0;
  for (int i = 0; i < n; ++i) {
    if (i + 1 < n && s[i] == '#' && s[i + 1] == '.') {
      ret++;
      s[i + 1] = '#';
    }
  }
  output(ret);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
