#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int wi = 0, bi = s.size() - 1;
  int wc = 0, bc = 0;
  int iter = 0;
  while (true) {
    if (iter == 0) {
      if (s[wi] == '#') {
        iter = 1;
        wc++;
      }
      wi++;
    } else {
      if (s[bi] == '.') {
        iter = 0;
        bc++;
      }
      bi--;
    }
    if (wi + (s.size() - bi) == s.size() - 1) {
      break;
    }
  }
  cout << wc + bc << endl;
  return 0;
}
