#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt = 1e9;
  vector<int> w(n + 1, 0);
  vector<int> b(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    w[i] = w[i - 1];
    b[i] = b[i - 1];
    if (s[i - 1] == '.') w[i]++;
    if (s[i - 1] == '#') b[i]++;
  }
  for (int i = 1; i < n; i++) {
    int cw = b[i];
    int cb = w[n] - w[i + 1];
    cerr << cw << " " << cb << endl;
    cnt = min(cnt, cw + cb);
  }
  cout << cnt << endl;
  return 0;
}
