#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0, ans2 = 0;
  string s1 = s, s2 = s;
  for (int i = 1; i < n; ++i) {
    if (s1[i] == '.' && s1[i - 1] == '#') {
      s1[i] = '#';
      ans++;
    }
  }
  for (int i = 1; i < n; ++i) {
    if (s2[i] == '.' && s2[i - 1] == '#') {
      s2[i - 1] = '.';
      ans2++;
    }
  }
  cout << min(ans, ans2);
}
