#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e+17;
const long long MODcdf = 998244353;
bool pairCompare(const pair<long long, long long>& firstElof,
                 const pair<long long, long long>& secondElof) {
  return firstElof.first < secondElof.first;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long mid = n / 2;
  long long rt, lt;
  long long time = 0;
  long long ans = INF;
  while (1) {
    rt = 0;
    lt = 0;
    time++;
    if (s[mid] != '#') mid++;
    for (long long i = 0; i < mid; i++) {
      if (s[i] == '#') lt++;
    }
    for (long long i = mid; i < n; i++) {
      if (s[i] == '.') rt++;
    }
    ans = min(ans, lt + rt);
    if (lt < rt)
      mid += mid / time;
    else if (lt > rt)
      mid -= mid / time;
    if (time == 20) break;
  }
  cout << ans << endl;
}
