#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> v(n + 1);
  for (int i = 0; i < n; i++) {
    v[i + 1] = v[i];
    if (s[i] == '#') {
      v[i + 1]++;
    }
  }
  int ans = n;
  for (int i = 0; i <= n; i++) {
    ans = min(ans, v[i] + (n - i - v[n] + v[i]));
  }
  cout << ans << endl;

  return 0;
}
