#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
signed main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string t = s;
  string u = s;
  int ans = 0;
  for (long long i = 0; i < (long long)(n - 1); i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ans++;
      s[i + 1] = '#';
    }
  }
  int cnt = 0;
  for (int i = n - 1; i >= 1; i--) {
    if (t[i] == '.' && t[i - 1] == '#') {
      cnt++;
      t[i - 1] = '.';
    }
  }
  chmin(ans, cnt);
  int a = 0, b = 0;
  for (long long i = 0; i < (long long)(n); i++) {
    if (u[i] == '#')
      a++;
    else
      b++;
  }
  int acnt = n - 1, bcnt = 0;
  while (u[bcnt] == '.' && bcnt < n) {
    bcnt++;
    --b;
  }
  while (u[acnt] == '#' && acnt >= 0) {
    --acnt;
    --a;
  }
  cout << min(a, b) << endl;
  return 0;
}
