#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  string s1;
  cin >> n >> s1;
  string s2 = s1;
  int cnt1 = 0, cnt2 = 0;
  for (int i = 1; i < s1.size(); i++) {
    if (s1[i] == '.' && s1[i - 1] == '#') {
      cnt1++;
      s1[i] = '#';
    }
    if (s2[s1.size() - i] == '.' && s2[s1.size() - i - 1] == '#') {
      cnt2++;
      s2[s1.size() - i - 1] = '.';
    }
  }
  cout << min(cnt1, cnt2) << endl;
}
