#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int min_count = n + 1;
  for (int k = 0; k < n - 1; k++) {
    int tmp = (int)count(s.begin(), s.begin() + k, '#');
    tmp += (int)count(s.begin() + k + 1, s.end(), '.');
    min_count = min(tmp, min_count);
  }
  cout << min_count << endl;
}
