#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  std::string S;
  cin >> N >> S;
  int ed_min = N;
  int dot_num_right = count(S.begin(), S.end(), '.');
  int shp_num_left = 0;
  for (int index = 0; index < N + 1; index++) {
    if (index > 0) {
      if (S[index - 1] == '.') {
        dot_num_right--;
      } else {
        shp_num_left++;
      }
    }
    int ed = shp_num_left + dot_num_right;
    if (ed < ed_min) {
      ed_min = ed;
    }
  }
  std::cout << ed_min << std::endl;
  return 0;
}
