#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int64_t n;
  string s;
  cin >> n >> s;
  bool count1 = false;
  int64_t res1 = 0;
  bool count2 = false;
  int64_t res2 = 0;
  for (int64_t i = 0; i < n; ++i) {
    if (count1) {
      if (s[i] == '.') {
        ++res1;
      }
    } else {
      if (s[i] == '#' && ((i < (n - 1)) && s[i + 1] == '.')) {
        count1 = true;
      }
    }
  }
  for (int64_t i = n - 1; i >= 0; --i) {
    if (count2) {
      if (s[i] == '#') {
        ++res2;
      }
    } else {
      if (s[i] == '#' && (i < (n - 1) && s[i + 1] == '.')) {
        count2 = true;
        ++res2;
      }
    }
  }
  cout << min(res1, res2) << endl;
  return 0;
}
