    #include<iostream>
    using namespace std;
     
    int main(){
      int n; cin >> n;
      string s; cin >> x;
      int pnt = 0;
      for(int i = 0; i < n; ++i){
        if(s[i] == '#')pnt++;
      }
      int ans;
      for(int i = n - 1; i >= 0; --i){
        if(s[i] == '.')pnt++;
        else pnt--;
      }
      if(ans < pnt)ans = pnt;
      cout << ans << endl;
      return 0;
    }