#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const long long LINF = 1LL << 60;
const long long MOD = 1e9 + 7;
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 n;
string s;
long long sm[2 * 100000 + 5];
long long sn[2 * 100000 + 5];
int main() {
  cin >> n >> s;
  if (s[0] == '#') sm[0] = 1;
  for (int i = (1); i <= (n - 1); i++) {
    if (s[i] == '#')
      sm[i] = sm[i - 1] + 1;
    else
      sm[i] = sm[i - 1];
  }
  for (int i = n - 1; i >= 0; --i) {
    if (s[i + 1] == '.')
      sn[i] = sn[i + 1] + 1;
    else
      sn[i] = sn[i + 1];
  }
  for (int i = (0); i <= (n - 1); i++) sm[i] += sn[i];
  long long mx = INF;
  for (int i = (0); i <= (n - 1); i++) {
    chmin(mx, sm[i]);
  }
  long long sm0 = sm[0] + (s[0] == '.' ? 1 : 0);
  chmin(mx, sm0);
  cout << mx;
  return 0;
}
