#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main(int argc, char const* argv[]) {
  int n, cnt1 = 0, cnt2 = 0;
  string s;
  cin >> n >> s;
  string t = s;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      cnt1++;
      s[i + 1] = '#';
    }
  }
  for (int i = n - 1; i >= 1; i--) {
    if (t[i] == '.' && t[i - 1] == '#') {
      cnt2++;
      t[i - 1] = '.';
    }
  }
  cout << min(cnt1, cnt2) << endl;
  return 0;
}
