#include <bits/stdc++.h>
using namespace std;
template <class T = long long>
T in() {
  T x;
  cin >> x;
  return (x);
}
template <class T>
void print(T x) {
  cout << x << "\n";
}
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> b(n);
  vector<long long> w(n);
  if (s[0] == '#') {
    b[0]++;
  } else {
    w[0]++;
  }
  for (int i = (1); i < (n); ++i) {
    if (s[i] == '#') {
      b[i]++;
    } else {
      w[i]++;
    }
    b[i] += b[i - 1];
    w[i] += w[i - 1];
  }
  long long ans = 2147483600;
  for (int i = 0; i < (n); ++i) {
    ans = min(ans, b[n - 1 - i] + w[n - 1] - w[n - 1 - i]);
  }
  cout << ans << endl;
  return 0;
}
