#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const long long LINF = 1LL << 60;
const long long MOD = 1e9 + 7;
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;
}
int n;
string s;
int sm[2 * 100000 + 5];
int sn[2 * 100000 + 5];
int main() {
  cin >> n >> s;
  for (int i = (1); i <= (n - 1); i++) {
    if (s[i] == '#')
      sm[i] = sm[i - 1] + 1;
    else
      sm[i] = sm[i - 1];
  }
  for (int i = (n - 2); i <= (0); i++) {
    if (s[i + 1] == '.')
      sn[i] = sn[i + 1] + 1;
    else
      sn[i] = sn[i + 1];
  }
  sm[0] = 0;
  sn[n - 1] = 0;
  for (int i = (0); i <= (n - 1); i++) sm[i] += sn[i];
  int mx = 0;
  for (int i = (0); i <= (n - 1); i++) {
    chmax(mx, sm[i]);
  }
  cout << mx;
  return 0;
}
