#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  string s;
  cin >> n;
  cin >> s;
  long long ans[n + 1];
  for (long long i = 0; i < n + 1; i++) ans[i] = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '.') ans[0]++;
  }
  for (long long i = 0; i < n; i++) {
    if (s[i] == '#')
      ans[i + 1] = ans[i] + 1;
    else
      ans[i + 1] = ans[i] - 1;
    cout << ans[i + 1];
  }
  sort(ans, ans + n + 1);
  cout << ans[0] << endl;
}
