#include <bits/stdc++.h>
using namespace std;
struct edge {
  long long to, cost;
};
const long long INF = 100000000000000000;
const long long INF2 = 9223372036854775807;
const long long MOD = 1000000007;
long long N;
string S;
signed main() {
  cin >> N >> S;
  long long sum = 0, sum2 = 0;
  for (long long i = 0; i < (long long)(S.size()); i++) {
    if (S[i] == '#') {
      sum++;
    } else {
      sum2++;
    }
  }
  long long cnt = 0, cnt2 = 0;
  long long Min = INF;
  Min = (((long long)(Min) < (long long)(sum)) ? (Min) : (sum));
  Min = (((long long)(Min) < (long long)(sum2)) ? (Min) : (sum2));
  for (long long i = 0; i < (long long)(S.size()); i++) {
    long long dim = 0;
    if (S[i] == '#') {
      dim = cnt2 + sum - cnt;
    } else {
      dim = cnt + sum2 - cnt2;
    }
    {} {}
    Min = (((long long)(Min) < (long long)(dim)) ? (Min) : (dim));
  }
  cout << Min << endl;
  return 0;
}
