#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int start = 0, end = N;
  for (int i = 0; i < N; i++)
    if (S[i] == '.')
      start++;
    else
      break;
  for (int i = N - 1; i >= 0; i--)
    if (S[i] == '#')
      end--;
    else
      break;
  vector<int> stone(end - start, '#');
  int change = 0;
  for (int i = start; i < end; i++)
    if (S[i] != '#') change++;
  int ans = change;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.')
      change--;
    else
      change++;
    ans = min(change, ans);
  }
  cout << ans << endl;
}
