#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}
void solve(long long N, std::string S) {
  ll ans = N;
  ll b = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') b++;
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      b--;
    } else {
      b++;
    }
    ans = min(ans, b);
  }
  std::cout << ans << std::endl;
}
int main() {
  long long N;
  scanf("%lld", &N);
  std::string S;
  std::cin >> S;
  solve(N, S);
  return 0;
}
