#include <bits/stdc++.h>
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 (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  std::cout << fixed << setprecision(15);
  ;
  long long n;
  string s;
  cin >> n >> s;
  long long cnt = 0;
  for (long long i = 0, i_len = (long long)(n); i < i_len; i++)
    if (s[i] == '#') cnt++;
  long long ans = 0;
  for (long long i = 0, i_len = (long long)(n); i < i_len; i++) {
    if (s[i] == '#' && i != n - 1) {
      if (s[i + 1] == '.') {
        s[i + 1] = '#';
        ans++;
      }
    }
  }
  cout << min(ans, cnt) << "\n";
}
