#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> white(n + 1), black(n + 1);
  for (int i = 1; i < n; i++) {
    if (s.at(i) == '#') black.at(i)++;
    black.at(i + 1) = black.at(i);
  }
  reverse((s).begin(), (s).end());
  for (int i = 1; i < n; i++) {
    if (s.at(i) == '.') white.at(i)++;
    white.at(i + 1) = white.at(i);
  }
  int ans = 2e5;
  for (int i = 0; i <= n; i++) ans = min(ans, black.at(i) + white.at(n - i));
  cout << ans << endl;
  return 0;
}
