#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return abs(a * b) / gcd(a, b); }
vector<ll> enum_div(ll n) {
  vector<ll> ret;
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i != 1 && i * i != n) ret.push_back(n / i);
    }
  }
  ret.push_back(n);
  return ret;
}
vector<bool> IsPrime;
void sieve(size_t max) {
  if (max + 1 > IsPrime.size()) IsPrime.resize(max + 1, true);
  IsPrime[0] = false;
  IsPrime[1] = false;
  for (size_t i = 2; i * i <= max; ++i)
    if (IsPrime[i])
      for (size_t j = 2; i * j <= max; ++j) IsPrime[i * j] = false;
}
const int mod = 1000000007;
ll n, a = 0, b = 0;
string s;
int main() {
  cin >> n >> s;
  ll i = 0;
  while (s[i] != '#' && i < n - 1) i++;
  for (i = i; i < n; i++) {
    if (s[i] == '#') a++;
    if (s[i] == '.') b++;
  }
  cout << (a < b ? a : b) << endl;
}
