#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 s;
  cin >> n >> s;
  string s2 = s;
  int cnt = 0, cnt2 = 0, cnt3 = 0;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s2[i] == '#' && s2[i + 1] == '.') {
      cnt++;
      s2[i + 1] = '#';
    }
    if (s[i] == '#') cnt2++;
    if (s[i] == '.') cnt3++;
  }
  cout << min({cnt, cnt2, cnt3}) << endl;
}
