#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, ans = 0, ans2 = 0;
  char s[200100];
  cin >> n >> s;
  for (int i = n - 1; s[i] == '.'; i--) ans2++;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '#') {
      ans++;
    }
  }
  cout << max(min(n - ans2, n - ans), 0);
}
