#include <bits/stdc++.h>
using namespace std;
const long int MOD = pow(10, 9) + 7;
int main() {
  int n;
  cin >> n;
  int countb = 0, countw = 0;
  char c;
  char c0, cn;
  for (int i = 0; i < n; ++i) {
    cin >> c;
    if (c == '#')
      countb++;
    else
      countw++;
    if (i == 0 && c == '.') countw--;
    if (i == n - 1 && c == '#') countb--;
  }
  if (countw > countb)
    cout << countb << endl;
  else
    cout << countw << endl;
  return 0;
}
