#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, min = INT32_MAX, l = 0, r = 0;
  string S;
  cin >> N >> S;
  for (int(i) = (0); (i) < (N); ++(i)) {
    if (S[i] == '.') r++;
  }
  for (int(i) = (0); (i) < (N); ++(i)) {
    if (S[i] == '.')
      r--;
    else
      l++;
    min = ((min) < (l + r)) ? (min) : (l + r);
  }
  cout << (min) << endl;
  return 0;
}
