#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = (ll)1e9 + 7;
const ll LL_MAX = 0x7fffffffffffffff;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int count = 0;
  int count2 = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] == '.' && s[i - 1] == '#') {
      count = 1;
      for (int j = i + 1; j < n; j++) {
        if (s[i] == '.') {
          count++;
        } else {
          break;
        }
      }
      count2 = 1;
      for (int j = i - 2; j >= 0; j--) {
        if (s[j] == '#') {
          count2++;
        } else {
          break;
        }
      }
      break;
    }
  }
  cout << min(count, count2);
  return 0;
}
