#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N, newN;
  string S;
  cin >> N >> S;
  newN = N;
  long long int ans1 = 0;
  for (long long int i = N - 1; i > -1; --i)
    if (S[i] == '.') {
      newN = i + 1;
      break;
    }
  for (long long int i = 0; i < newN; ++i)
    if (S[i] == '.') ++ans1;
  ans1 = ans1 < newN - ans1 ? ans1 : newN - ans1;
  long long int ans2 = 0;
  for (long long int i = 0; i < N; ++i)
    if (S[i] == '.') ++ans2;
  cout << (ans1 < ans2 ? ans1 : ans2) << endl;
}
