Language: C++

#include<iostream>
#include <vector>
#include <algorithm>
#include <string>

int main() {
    string S;
    long N;
    cin >>N>> S;
    long count_front = count(S.begin(),S.end(),'#');
    long count_back = count(S.begin(),S.end(),'.');
    if (count_front>count_back){
        cout << count_back << endl;
    } else{
        cout << count_front << endl;
    }
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'string' was not declared in this scope
    7 |     string S;
      |     ^~~~~~
a.cc:7:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |     cin >>N>> S;
      |     ^~~
      |     std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:15: error: 'S' was not declared in this scope
    9 |     cin >>N>> S;
      |               ^
a.cc:10:24: error: 'count' was not declared in this scope; did you mean 'std::count'?
   10 |     long count_front = count(S.begin(),S.end(),'#');
      |                        ^~~~~
      |                        std::count
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: 'std::count' declared here
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
a.cc:13:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |         cout << count_back << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |         cout << count_back << endl;
      |                               ^~~~
      |                               std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:15:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |         cout << count_front << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |         cout << count_front << endl;
      |                                ^~~~
      |                                std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~