#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt_l = 0;
  for (int i = n - 2; i >= 0; --i) {
    auto sub = s.substr(i, 2);
    if (sub == "#.") ++cnt_l;
  }
  int cnt_r = 0;
  for (int i = 0; i < n - 1; ++i) {
    auto sub = s.substr(i, 2);
    if (sub == "#.") ++cnt_r;
  }
  cout << min(cnt_l, cnt_r) << endl;
  return 0;
}
