#include <bits/stdc++.h>
using namespace std;
const long long dx[] = {0, -1, 0, 1};
const long long dy[] = {1, 0, -1, 0};
const long long MOD = (1000000007);
const long long INF = (1LL << 60) - 1;
const double EPS = (1 >> 30);
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
using Graph = vector<vector<pair<long long, long long>>>;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(10);
  long long n;
  string s;
  cin >> n >> s;
  long long siro = 0;
  long long kuro = 0;
  long long st = 0;
  for (long long i = 0; i < n - 1; i++) {
    if (st == 1) {
      if (s[i + 1] == '.') siro++;
      if (s[i + 1] == '#') kuro++;
    }
    if (s[i] == '#' && s[i + 1] == '.' && st == 0) {
      st = 1;
      siro = 1;
    }
  }
  cout << min(siro, kuro) << endl;
}
