#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int r = -1;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') r = i;
  }
  if (r == -1) return cout << 0 << "\n", 0;
  int l = -1;
  for (int i = 0; i < r; i++) {
    if (S.at(i) == '.') {
      l = i;
      break;
    }
  }
  if (l == -1) return cout << 0 << "\n", 0;
  if (l > r) return cout << 0 << "\n", 0;
  cout << r - l << "\n";
}
