#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  vector<int> turn;
  cin >> n;
  cin >> s;
  int l = n - 1, m = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      l = i;
      break;
    }
  }
  if (l == n - 1) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = n - 1; i > 0; i--) {
    if (s[i] == '.') {
      m = i;
      break;
    }
  }
  for (int i = l; i <= m; i++) {
    int a = 0;
    for (int j = l; j <= m; j++) {
      if ((j < i && s[j] == '#') || (j > i && s[j] == '.')) {
        a++;
      }
    }
    turn.push_back(a);
  }
  cout << turn[*min_element(turn.begin(), turn.end())] << endl;
  return 0;
}
