#include <bits/stdc++.h>
using namespace std;
const int N = int(5e5) + 2;
const int LG = 20;
const long long mod = 998244353;
const int INF = 2147483647;
const long long linf = 1e18;
const long double pi = acos(-1);
const long double EPS = 1e-10;
int n;
string s;
int main() {
  cin >> n >> s;
  int ok = 0, ans1 = 0;
  for (int i = 0; i < ((int)(s).size()); ++i) {
    if (s[i] == '#')
      ok = 1;
    else
      ans1 += (ok == 1);
  }
  int ans2 = 0;
  ok = 0;
  for (int i = 0; i < ((int)(s).size()); ++i) {
    if (s[i] == '#')
      ok++;
    else {
      ans2 += ok;
      ok = 0;
    }
  }
  cout << min(ans1, ans2) << "\n";
  return 0;
}
