#include <bits/stdc++.h>
using namespace std;
template <typename T>
void remove(std::vector<T>& vector, unsigned int index) {
  vector.erase(vector.begin() + index);
}
long long int ss[200006];
int main() {
  long long int n, count = 200000000;
  string s;
  cin >> n >> s;
  if (s[0] == '#') ss[0] = 1;
  for (long long int i = 1; i < n; i++) {
    if (s[i] == '#') {
      ss[i] = ss[i - 1] + 1;
    } else {
      ss[i] = ss[i - 1];
    }
  }
  count = min(count, ss[n - 1]);
  for (int i = 1; i < n; i++) {
    count = min(n - (ss[n - 1] - ss[i - 1]) + (ss[i - 1] - ss[0]), count);
  }
  cout << min(count, n - ss[n - 1]) << endl;
}
