#include <bits/stdc++.h>
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;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
using namespace std;
int main(void) {
  int n, a[300], temae[200001] = {}, muko[200001] = {};
  char s[200001];
  int ans = 200001;
  cin >> n >> s;
  for (int i = 0, i_len = (n); i < i_len; ++i) {
    if (s[i] == '#') temae[i]++;
    if (i + i < n) temae[i + 1] = temae[i];
  }
  for (int i = 0, i_len = (n); i < i_len; ++i) {
    if (s[n - i - 1] == '#') muko[n - i - 1]++;
    if (n - i - 2 >= 0) s[n - i - 2] = s[n - i - 1];
  }
  for (int i = 0, i_len = (n); i < i_len; ++i) {
    chmin(ans, n + temae[i] - muko[i]);
    chmin(ans, n - temae[i] + muko[i]);
  }
  cout << ans << endl;
  return 0;
}
