#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int black = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      black++;
    }
  }
  vector<int> ans;
  ans.push_back(black);
  ans.push_back(n - black);
  int count = 0;
  bool flag = true;
  while (flag) {
    flag = false;
    for (int i = 0; i + 1 < s.size(); i++) {
      if (s[i] == '#' && s[i + 1] == '.') {
        count++;
        s.erase(i, 2);
        flag = true;
      }
    }
  }
  ans.push_back(count);
  sort(ans.begin(), ans.end());
  cout << ans[0] << "\n";
  return 0;
}
