#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int INF = 1001001001;

int main(){
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count = 0;
  for(int i=0;i<n;i++){
    if(s.at(i) == '#') count++;
  }
  int ans = count;
  for(int i=n-1;i>=0;i--){
    if(s.at(i) == '.') count++; else count--;
    ans = min(ans,count);
  }
  cout << ans << endl;
}