#include <bits/stdc++.h>
using namespace std;
template <typename T>
void cmin(T &a, T b) {
  a = min(a, b);
}
template <typename T>
void cmax(T &a, T b) {
  a = max(a, b);
}
const long long mod = 998244353;
signed main() {
  long long n;
  string s;
  cin >> n >> s;
  long long black[200005] = {}, white[200005] = {};
  for (long long i = 0; i < (n); i++) {
    if (s[i] == '#')
      black[i + 1] = 1;
    else
      white[i + 1] = 1;
  }
  for (long long i = 0; i < (n + 1); i++)
    black[i + 1] += black[i], white[i + 1] += white[i];
  long long ans = 1e10;
  for (long long i = (1); i < (n + 1); i++) {
    long long leftB = black[i];
    long long rightB = black[n] - black[i];
    long long rightW = white[n] - white[i];
    long long tmp = min(rightB, rightW);
    cmin(ans, leftB + tmp);
  }
  cout << (ans == 1e10 ? 0 : ans) << endl;
  return 0;
}
