#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long double pii = 3.14159265359;
const int MOD = 1000000007;
const char nl = '\n';
const long long INF = 1e18;
const int MX = 100001;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string second;
  cin >> second;
  vector<int> pref1(n), pref2(n);
  int j = 0;
  for (int i = 0; i < (n); i++) {
    if (second[i] == '#') j++;
    pref1[i] = j;
  }
  j = 0;
  for (int i = (n)-1; i >= 0; i--) {
    if (second[i] == '.') j++;
    pref2[i] = j;
  }
  int mn = min(pref2[0], pref1.back());
  for (int i = 0; i < (n - 1); i++) {
    mn = min(mn, pref2[i] + pref1[i + 1]);
  }
  cout << mn;
  return 0;
}
