#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m, k, x, y, res = 0, l, a = 0, b = 0, c = 0, d = 0, cnt = 0,
                           sum = 0, z;
  string second;
  cin >> n;
  cin >> second;
  bool yup = false;
  bool loda = false;
  for (long long i = n - 1; i >= 0; i--) {
    if (second[i] == '.') yup = true;
    if (second[i] == '#') loda = true;
    if (second[i] == '#' && yup == 1) res++;
    if (second[i] == '.' && loda == 1) cnt++;
  }
  cout << min(cnt + 1, res);
}
int main() {
  long long t;
  t = 1;
  while (t--) solve();
}
