#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  string str;
  cin >> str;
  vector<int> arr(2, 0);
  int arrsize = str.size();
  for (int i = str.size() - 1; i != 0; i--) {
    if (str[i] == '#')
      arrsize--;
    else
      break;
  }
  for (int i = 0; i != arrsize; i++) {
    if (str[i] == '#')
      arr[0]++;
    else
      arr[1]++;
  }
  cout << min(arr[0], arr[1]) << endl;
  return 0;
}
