#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int pnt = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') pnt++;
  }
  int ans;
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] == '.')
      pnt++;
    else
      pnt--;
  }
  if (ans < pnt) ans = pnt;
  cout << n - ans << endl;
  return 0;
}
