#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int min = 100000;
  for (int i = 0; i < n; i++) {
    int count = 0;
    for (int j = 0; j <= i; j++) {
      if (s[j] == '#') count++;
      if (count > min) break;
    }
    for (int j = i + 1; j < n; j++) {
      if (s[j] == '.') count++;
      if (count > min) break;
    }
    if (count < min) min = count;
  }
  cout << min << endl;
}
