#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using R = double;
using Data = pair<ll, vector<int>>;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 50;
struct edge {
  ll from;
  ll to;
  ll cost;
};
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans1 = 0;
  int ans2 = 0;
  int temp = -1;
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] == '.') {
      temp = i;
      break;
    }
  }
  if (temp != -1) {
    for (int i = 0; i < temp + 1; ++i) {
      if (s[i] == '#') ans1++;
    }
    for (int i = 0; i < n; ++i) {
      if (s[i] == '.') ans2++;
    }
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
