#include <bits/stdc++.h>
using namespace std;
long long n;
void solve() {
  string a;
  cin >> a;
  long long i, ans = 0, l = a.length();
  for (i = 1; i < l; i++)
    if (a[i] == '.' && a[i - 1] == '#') ans++;
  cout << min(l - ans, ans) << endl;
}
int main() {
  while (cin >> n) solve();
}
