#include <bits/stdc++.h>
using namespace std;
template <size_t SIZE, class T>
inline size_t array_size(T (&arr)[SIZE]) {
  return SIZE;
}
int main() {
  int N;
  string S;
  cin >> N >> S;
  int least = INT_MAX;
  for (int i = 0; i <= N; ++i) {
    int num = 0;
    for (int j = 0; j < N; ++j) {
      if (j >= i) {
        if (S[j] != '#') {
          ++num;
        }
      } else {
        if (S[j] != '.') {
          ++num;
        }
      }
    }
    least = std::min(least, num);
  }
  cout << least << endl;
  return 0;
}
