#include <bits/stdc++.h>
using namespace std;
int n, posx, posy;
string s;
int main() {
  cin >> n;
  cin >> s;
  s = "." + s + "#";
  posx = 0;
  posy = n + 1;
  for (int i = 1; i <= n; ++i)
    if (s[i] == '.')
      posx = i;
    else
      break;
  for (int i = n; i > 0; --i)
    if (s[i] == '#')
      posy = i;
    else
      break;
  int demx = 0, demy = 0;
  for (int i = posx + 1; i < posy; ++i)
    if (s[i] == '.')
      demx++;
    else
      demy++;
  cout << min(demx, demy);
  return 0;
}
