#include <bits/stdc++.h>
using namespace std;
const int inf = INT_MAX;
const int MAX = 510000;
const long long MOD = 1000000007;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long w = 0, b = 0, lw = 0, rb = 0;
  for (long long i = (0); i < (n); ++i) {
    if (s[i] == '#')
      b++;
    else
      w++;
  }
  for (long long i = (0); i < (n); ++i) {
    if (s[i] == '.')
      lw++;
    else
      break;
  }
  for (long long i = (n - 1); i >= (0); --i) {
    if (s[i] == '#')
      rb++;
    else
      break;
  }
  cout << min(w - lw, b - rb) << endl;
}
