#include <bits/stdc++.h>
using namespace std;
template <typename T>
void remove(std::vector<T> &vector, unsigned int index) {
  vector.erase(vector.begin() + index);
}
template <class T>
T ma(vector<T> &v) {
  T maxi = 0;
  for (auto &i : v) maxi = max(maxi, i);
  return maxi;
}
long long ans = 0;
int main() {
  unsigned long long n;
  cin >> n;
  string s;
  cin >> s;
  unsigned long long black = 0, white = 0;
  for (int i = 0; i <= s.size() - 1; i++)
    if (s[i] == '.')
      black++;
    else
      white++;
  cout << min(black, white) << endl;
}
