#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const long long INFL = 9 * 1e18;
long long inline digit(long long num) {
  int tmp = 0;
  while (num) {
    tmp++;
    num /= 10;
  }
  return tmp;
}
template <typename T>
inline T digitSum(T num) {
  T sum = 0;
  while (num) {
    sum += num % 10;
    num /= 10;
  }
  return sum;
}
template <typename T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <typename T>
inline T lcm(T a, T b) {
  T g = gcd(a, b);
  return a / g * b;
}
template <typename T>
inline T power(T a, T b) {
  T tmp = 1;
  for (int i = 0; i < ((int)(b)); ++i) {
    tmp *= a;
  }
  return tmp;
}
int ctoi(char c) { return c - '0'; }
bool isOk(long long key, long long value) { return key >= value; }
long long binary_search(vector<long long> a, long long key) {
  long long ok = a.size() - 1;
  long long ng = 0;
  while (abs(ok - ng) > 1) {
    long long mid = (ok + ng) / 2;
    if (isOk(key, a[mid]))
      ok = mid;
    else
      ng = mid;
  }
  return ok;
}
bool isPrime(long long n) {
  for (int i = 2; n >= i * i; ++i) {
    if (!(n % i)) return false;
  }
  return true;
}
vector<long long> primes(long long n) {
  vector<long long> v(1, 1);
  for (long long i = 2; n >= i * i; ++i) {
    if (!(n % i)) {
      v.push_back(i);
    }
  }
  if (v.size() == 1) v.push_back(n);
  return v;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int bw = 0;
  bool exist = false;
  for (int i = 0; i < ((int)(n)); ++i) {
    if (s[i] == '.') {
      exist = true;
    }
    if (exist && s[i] != '.') {
      bw++;
    }
  }
  int b = 0, w = 0;
  for (int i = 0; i < ((int)(n)); ++i) {
    if (s[i] == '.')
      w++;
    else
      b++;
  }
  int ans = min(bw, min(w, b));
  cout << (ans) << endl;
  return 0;
}
