#include <bits/stdc++.h>
int _ = (std::cin.tie(nullptr), std::ios::sync_with_stdio(false),
         std::cout.precision(10), std::cout.setf(std::ios::fixed));
using ll = long long;
using ld = long double;
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> b(N, 0), w(N, 0);
  b[0] = S[0] == '#' ? 1 : 0;
  for (int i = (1); i < int(N); ++i) {
    b[i] = b[i - 1] + ((S[i] == '#') ? 1 : 0);
    w[N - i - 1] = w[N - i] + (S[N - i] == '.' ? 1 : 0);
  }
  int answer = numeric_limits<int>::max();
  for (int i = (0); i < int(N); ++i) {
    answer = min(answer, b[i] + w[i]);
  }
  cout << answer << endl;
  return 0;
}
