#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
bool coY() { cout << "Yes" << endl; }
bool coN() { cout << "No" << endl; }
const ll INF = 1LL << 60;
ll n, m;
string s;
const int mod = 1e9 + 7;
int main() {
  cin >> n;
  cin >> s;
  vector<int> num_black(n);
  int count = 0;
  for (int i = (0); i < (n); ++i) {
    if (s[i] == '#') {
      count++;
    }
    num_black[i] = count;
  }
  int all_black, all_white, blwh;
  all_black = n - num_black[n - 1];
  all_white = num_black[n - 1];
  blwh = 500100;
  for (int i = (0); i < (n); ++i) {
    int kuro = num_black[i];
    int siro = (n - i) - (num_black[n - 1] - num_black[i]);
    chmin(blwh, siro + kuro);
  }
  int ans = min({all_white, all_black, blwh});
  cout << ans << endl;
}
