#include <bits/stdc++.h>
using namespace std;
template <typename T>
void printlnVector(T v) {
  for (int i = 0; i < (int)(v.size()); i++) {
    cout << v[i] << endl;
  }
}
template <typename T>
void printVector(T v) {
  for (int i = 0; i < (int)(v.size()); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 0;
  for (int i = 0; i < (int)(N); i++) {
    if (S.back() == '#') S.pop_back();
  }
  for (int i = 0; i < (int)(S.size()); i++) {
    if (S[i] == '.') ans++;
  }
  N = S.size();
  ans = min(ans, N - ans);
  cout << ans << endl;
  return 0;
}
