#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 61;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
long long jou(long long N, long long P) {
  if (P == 0) return 1;
  if (P % 2 == 0) {
    long long t = jou(N, P / 2);
    return t * t % 1000000007;
  }
  return (N * jou(N, P - 1)) % 1000000007;
}
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> bl(n);
  vector<int> wh(n);
  int cnt = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == '#') cnt++;
    bl[i] = cnt;
  }
  cnt = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') cnt++;
    wh[i] = cnt;
  }
  int ans = 999999;
  for (int i = 0; i < (int)(n); i++) {
    chmin(ans, bl[i] + wh[i]);
  }
  chmin(ans, wh[0]);
  chmin(ans, bl[n - 1]);
  cout << ans << endl;
}
