#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int min = n;
  for (int i = 0; i <= n; i++) {
    int c_b = 0, c_w = 0;
    for (int j = 0; j < n; i++) {
      string t = s.substr(j, 1);
      if (j < i && s == "#") c_b++;
      if (j >= i && s == ".") c_w++;
    }
    if (min > c_b + c_w) min = c_b + c_w;
  }
  cout << min << endl;
}
