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