#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main(int argc, char const* argv[]) {
  int n;
  string s;
  cin >> n >> s;
  vector<int> v(n, 0);
  if (s[0] == '#') v[0] = 1;
  for (int i = 0; i < n; i++) {
    v[i + 1] = v[i];
    if (s[i + 1] == '#') v[i + 1]++;
  }
  int ans = n;
  for (int i = 0; i < (n); i++) {
    int b = v[i];
    int w = (n - i) - (v[n - 1] - v[i] + 1);
    ans = min(ans, b + w);
  }
  cout << ans << endl;
  return 0;
}
