#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 INF = 1e18;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> l(n, 0);
  vector<long long> r(n, 0);
  for (long long i = 0; i < (n); ++i) {
    if (i != 0) l[i] = l[i - 1];
    if (s[i] == '#') {
      l[i]++;
    }
  }
  for (int i = n - 2; i >= 0; i--) {
    r[i] = r[i + 1];
    if (s[i + 1] == '.') {
      r[i]++;
    }
  }
  long long ans = INF;
  for (long long i = 0; i < (n); ++i) {
    chmin(ans, l[i] + r[i]);
  }
  cout << ans << endl;
  return 0;
}
