#include <bits/stdc++.h>
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
using namespace std;
constexpr int MOD = 1000000007;
void print(const std::vector<int>& v) {
  std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
  std::cout << std::endl;
}
int main() {
  long long N;
  cin >> N;
  vector<char> S(N);
  for (long long i = 0; i < (long long)N; i++) cin >> S[i];
  long long a = 0;
  long long b = 0;
  long long c = 0;
  for (long long i = 0; i < (long long)N; i++) {
    if (S[i] != '.')
      a++;
    else
      b++;
    if (i < N - 1LL and S[i] != '.') c++;
    if (i == N - 1LL and S[i] != '#') c++;
  }
  cout << min(a, min(b, c)) << endl;
}
