#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
constexpr int MOD = 1000000007;
const int INF = 1 << 30;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string t = s;
  int res1 = 0, res2 = 0;
  for (int i = 0; i < (int)(n - 1); i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      s[i + 1] = '#';
      res1++;
    }
  }
  for (int i = 0; i < (int)(n - 1); i++) {
    if (t[n - 1 - i] == '.' && t[n - 2 - i] == '#') {
      t[n - 2 - i] = '.';
      res2++;
    }
  }
  cout << min(res1, res2) << "\n";
  return 0;
}
