#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  int n;
  string s;
  cin >> n >> s;
  long long bnum = 0, wnum = 0, b = 0;
  vector<int> bsum(n + 1, 0);
  vector<int> wsum(n + 1, 0);
  for (int(i) = 0; (i) < (n); (i)++) {
    if (s[i] == '#')
      bsum[i]++;
    else
      wsum[i]++;
  }
  for (int(i) = 0; (i) < (n); (i)++) {
    bsum[i + 1] += bsum[i];
    wsum[i + 1] += wsum[i];
  }
  int res = 1e9;
  for (int i = 1; i <= n; i++) {
    res = min(res, bsum[i] + (wsum[n] - wsum[min(i + 1, n)]));
  }
  cout << res << endl;
  return 0;
}
