#include <bits/stdc++.h>
static const long long int MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
const long double EPS = 0.0000000001;
const long double PI = (acos(-1));
const int MOD = 1000000007;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
int main() {
  long long int n;
  cin >> n;
  long long int ans1 = 0, ans2 = 0;
  string s;
  cin >> s;
  string s1 = s;
  string s2 = s;
  for (int i = 0; i < (int)(s1.length() - 1); i++) {
    if (s1[i] == '#' && s1[i + 1] == '.') {
      ans1++;
      s1[i + 1] = '#';
    }
  }
  for (int i = s2.length() - 1; i > 0; i--) {
    if (s2[i] == '.' && s2[i - 1] == '#') {
      ans2++;
      s2[i - 1] = '.';
    }
  }
  cout << min(ans1, ans2);
}
