#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e10;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int wb = 0, bw = 0;
  for (int i = n - 1; i > 0; i--)
    if (s[i] == '.' && s[i - 1] == '#') {
      wb = i;
      break;
    }
  for (int i = 0; i < n - 1; i++)
    if (s[i] == '#' && s[i + 1] == '.') {
      bw = i;
      break;
    }
  int cb = 0, cw = 0;
  for (int i = bw + 1; i < n; i++)
    if (s[i] == '#') cb++;
  for (int i = wb; i >= 0; i--)
    if (s[i] == '.') cw++;
  cout << min(cb, cw) << endl;
  return 0;
}
