#include <bits/stdc++.h>
using namespace std;
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 * b) / gcd(a, b); }
using P = pair<int, int>;
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 MOD = 1000000007;
long long INF = 1 << 30;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> black(n), white(n);
  int b = 0, w = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') b++;
    black[i] = b;
    if (s[i] == '.') w++;
    white[i] = w;
  }
  if (b == 0 || w == 0) {
    cout << 0 << endl;
    return 0;
  }
  int ans = 1001001;
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    cnt += black[i];
    cnt += w - white[i];
    ans = min(ans, cnt);
  }
  cout << ans << endl;
}
