#include <bits/stdc++.h>
using namespace std;
typedef vector<vector<long long>> matrix;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
long long llpow(long long e, long long x) {
  long long res = 1LL;
  while (x) {
    if (x & 1) res *= e;
    e *= e;
    x /= 2;
  }
  return res;
}
long long gcd(long long A, long long B) {
  if (A < B) swap(A, B);
  while (B) {
    long long w = A % B;
    A = B;
    B = w;
  }
  return A;
}
long long lcm(long long A, long long B) { return A / gcd(A, B) * B; }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long N;
  cin >> N;
  string second;
  cin >> second;
  while (second[N - 1] == '#') N--;
  long long b = 0, w = 0;
  for (long long i = 0; i < (N); i++) {
    if ('.' == second[i])
      w++;
    else
      b++;
  }
  cout << min(b, w) << "\n";
}
