#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
using P = pair<long long, long long>;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
const long long dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const long long dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const long long INF = 1e15;
const long long MOD = 1e9 + 7;
signed main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long alw = 0, alb = 0, chan = 0;
  for (long long i = 0; i < (long long)n; i++) (s[i] == '#' ? alw : alb)++;
  bool f = true;
  for (long long i = n - 1; i >= 0; i--) {
    if (f && s[i] == '#')
      continue;
    else
      f = 0;
    chan += (s[i] == '.');
  }
  cout << min({alw, alb, chan}) << endl;
}
