#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string S;
  cin >> S;
  int ans = 0;
  bool cnt_flag = false;
  for (auto c : S) {
    if (c == '#') cnt_flag = true;
    if (cnt_flag && c == '.') ans += 1;
  }
  reverse(S.begin(), S.end());
  int _ans;
  cnt_flag = false;
  for (auto c : S) {
    if (c == '.') cnt_flag = true;
    if (cnt_flag && c == '#') _ans += 1;
  }
  cout << min(ans, _ans) << endl;
}
