#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long mod = 1e9 + 7;
const long long INF = 1LL << 60;
const long long m = 1LL << 32;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> sum(n + 1, 0);
  for (long long i = 0; i < (n); i++) {
    sum[i + 1] = sum[i] + (s[i] == '#');
  }
  long long mi = INF;
  for (long long i = 1; i < (n + 1); i++) {
    mi = min(mi, sum[i] + ((n - i) - (sum[n] - sum[i])));
  }
  cout << mi << endl;
  return 0;
}
