#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, dem1 = 0, dem2 = 0;
  cin >> n;
  string s;
  fflush(stdin);
  cin >> s;
  for (i = 0; i < n; i++)
    if (s[i] == '#')
      dem1++;
    else
      dem2++;
  i = 0;
  while (s[i] == '.') {
    dem2--;
    i++;
  }
  if (dem1 < dem2)
    cout << dem1;
  else
    cout << dem2;
  return 0;
}
