Language: C++

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

int main() {
	int N;
	cin >> N;
	vector<string> vec(N);
	for (int i = 0; i < N; i++) {
		cin >> vec.at(i);
	}
	int count = 0;
	int twin = 0;
	int begin = 0;
	int end = 0;
	for (int i = 0; i < N; i++) {
		if(vec(i).at(0) == 'C' && vec(i).at(vec(i).size() - 1) == 'A'){
			twin++;
		}
		if (vec(i).at(0) == 'C' && vec(i).at(vec(i).size() - 1) != 'A') {
			begin++;
		}
		if (vec(i).at(0) != 'C' && vec(i).at(vec(i).size() - 1) == 'A') {
			end++;
		}
		for (int k = 0; k < vec(i).size() - 1; k++) {
			if (vec(i).at(k) == 'A' && vec(i).at(k + 1) == 'B') {
				count++;
			}
		}
	}
	cout += twin - 1;
	if (begin != 0) {
		count++;
	}
	if (end != 0) {
		count++;
	}
	cout << count << endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   16 |                 if(vec(i).at(0) == 'C' && vec(i).at(vec(i).size() - 1) == 'A'){
      |                    ~~~^~~
a.cc:16:46: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   16 |                 if(vec(i).at(0) == 'C' && vec(i).at(vec(i).size() - 1) == 'A'){
      |                                           ~~~^~~
a.cc:16:56: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   16 |                 if(vec(i).at(0) == 'C' && vec(i).at(vec(i).size() - 1) == 'A'){
      |                                                     ~~~^~~
a.cc:19:24: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   19 |                 if (vec(i).at(0) == 'C' && vec(i).at(vec(i).size() - 1) != 'A') {
      |                     ~~~^~~
a.cc:19:47: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   19 |                 if (vec(i).at(0) == 'C' && vec(i).at(vec(i).size() - 1) != 'A') {
      |                                            ~~~^~~
a.cc:19:57: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   19 |                 if (vec(i).at(0) == 'C' && vec(i).at(vec(i).size() - 1) != 'A') {
      |                                                      ~~~^~~
a.cc:22:24: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   22 |                 if (vec(i).at(0) != 'C' && vec(i).at(vec(i).size() - 1) == 'A') {
      |                     ~~~^~~
a.cc:22:47: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   22 |                 if (vec(i).at(0) != 'C' && vec(i).at(vec(i).size() - 1) == 'A') {
      |                                            ~~~^~~
a.cc:22:57: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   22 |                 if (vec(i).at(0) != 'C' && vec(i).at(vec(i).size() - 1) == 'A') {
      |                                                      ~~~^~~
a.cc:25:40: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   25 |                 for (int k = 0; k < vec(i).size() - 1; k++) {
      |                                     ~~~^~~
a.cc:26:32: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   26 |                         if (vec(i).at(k) == 'A' && vec(i).at(k + 1) == 'B') {
      |                             ~~~^~~
a.cc:26:55: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   26 |                         if (vec(i).at(k) == 'A' && vec(i).at(k + 1) == 'B') {
      |                                                    ~~~^~~
a.cc:31:14: error: no match for 'operator+=' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
   31 |         cout += twin - 1;
      |         ~~~~~^~~~~~~~~~~