#include <bits/stdc++.h>
const int INF = 2147483647;
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  ll n;
  string s;
  cin >> n >> s;
  vector<pair<ll, ll>> vp(n);
  for (long long i = 0; i < (n); ++i) {
    if (i > 0) vp[i] = vp[i - 1];
    if (s[i] == '#')
      vp[i].first++;
    else
      vp[i].second++;
  }
  ll res = LONG_LONG_MAX;
  for (long long i = 0; i < (n); ++i)
    res = min(res, vp[i].first + (vp[n - 1].second - vp[i].second));
  cout << res << endl;
  return 0;
}
