#include <bits/stdc++.h>
using namespace std;
template <typename T>
void view(T e) {
  std::cout << e << std::endl;
}
template <typename T>
void view(const std::vector<T>& v) {
  for (const auto& e : v) {
    std::cout << e << " ";
  }
  std::cout << std::endl;
}
template <typename T>
void view(const std::vector<std::vector<T> >& vv) {
  for (const auto& v : vv) {
    view(v);
  }
}
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int MOD = 1000000007;
const int INF = 1e9;
const int mod = 1000000007;
const int inf = 1e9;
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int ddx[8] = {1, 1, 1, -1, -1, -1, 0, 0};
int ddy[8] = {0, 1, -1, 0, 1, -1, 1, -1};
int main() {
  int n;
  string s;
  cin >> n >> s;
  cout << s.size() << endl;
  int all = count(s.begin(), s.end(), '#');
  vector<int> a(n + 1, 0);
  for (int i = n - 1; i >= 0; i--) {
    a[i] = a[i + 1] + (s[i] == '#');
  }
  int ans = INF;
  for (int i = 0; i <= n; i++) {
    int now = (n - i - a[i]) + (all - a[i]);
    chmin(ans, now);
  }
  cout << ans << endl;
}
