#include <bits/stdc++.h>
using namespace std;
signed main() {
  int N;
  string S;
  cin >> N >> S;
  int i;
  int c1 = 0;
  for (i = 1; i < N; i++)
    if (S[i - 1] == '#' && S[i] == '.') break;
  for (; i < N; i++)
    if (S[i] == '.') c1++;
  int c2 = 0;
  for (i = N - 2; i >= 0; i--)
    if (S[i] == '#' && S[i + 1] == '.') break;
  for (; i >= 0; i--)
    if (S[i] == '#') c2++;
  cout << min(c1, c2) << endl;
  return 0;
}
