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