#include <bits/stdc++.h>
using namespace std;
const long long int MaxN = 10000005;
const long long int mod = 1e9 + 7;
const float pi = 3.1415926535897932384626433832795028;
long long int mcd(long long int a, long long int b) {
  if (a == 0) return b;
  return mcd(b % a, a);
}
int main() {
  cin.tie(0), ios_base::sync_with_stdio(0);
  long long int N, i, p, q, res;
  cin >> N;
  string stones;
  cin >> stones;
  p = q = 0;
  for (i = 0; i < N - 1; i++) {
    if (stones[i] == '.')
      p += 1;
    else
      q += 1;
  }
  if (p > q) {
    cout << q;
  } else {
    if (stones[N - 1] == '.') p += 1;
    cout << p;
  }
}
