#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int tmp1 = count(s.begin(), s.end() - 1, '#');
  if (s[n - 1] == '#') {
    int a = 0;
    for (int i = n - 1; i >= 0; i--) {
      if (s[i] == '#') {
        a++;
        continue;
      }
      break;
    }
    int tmp2 = count(s.begin(), s.end() - a, '#');
    cout << std::min(tmp1, tmp2) << endl;
  } else {
    int b = 0;
    for (int i = n - 2; i >= 0; i--) {
      if (s[i] == '#') {
        b++;
        continue;
      }
      break;
    }
    int tmp3 = count(s.begin(), s.end() - b - 1, '#') + 1;
    cout << std::min(tmp1, tmp3) << endl;
  }
}
