#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  bool flag = false;
  int most_count = n;
  int min_count;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      flag = true;
      min_count = count(s.begin() + i, s.end(), '.');
    }
    if (flag && (s[i] == '.')) {
      min_count--;
    }
    if (flag && (s[i] == '#')) {
      min_count++;
    }
    if (flag == true && (min_count < most_count)) most_count = min_count;
  }
  cout << most_count << endl;
}
