#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> a;
  int black = 0;
  int white = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.') white++;
  }
  cout << white << endl;
  for (int i = 0; i < n - 1; ++i) {
    if (s[i] == '#')
      black++;
    else
      white--;
    if (s[i] == '#' && s[i + 1] == '.') {
      a.push_back(black + white);
    }
  }
  if (a.empty())
    cout << 0 << endl;
  else {
    sort(begin(a), end(a));
    cout << a[0] << endl;
  }
}
