#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> shiro(n, 0);
  vector<int> kuro(n, 0);
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') shiro[i]++;
    if (s[i] == '#') kuro[i]++;
  }
  vector<int> white(n + 1, 0);
  vector<int> black(n + 1, 0);
  white[0] = black[0] = 0;
  for (int i = 0; i < n; i++) {
    white[i + 1] = white[i] + shiro[i];
    black[i + 1] = black[i] + kuro[i];
  }
  reverse(white.begin(), white.end());
  int ans = 1000000000;
  for (int i = 0; i < n + 1; i++) {
    ans = min(ans, black[i] + white[i]);
  }
  cout << ans << endl;
  return 0;
}
