#include <iostream>
using namespace std;
class DeviceCounter {
private:
int count;
public:
DeviceCounter(int c = 0) : count(c) {}
DeviceCounter& operator++(){ //return type is add of obj as preincrement result in a l-value
this->count++;
return*this;
}
int getCount() const {
return count;
}
};
int main() {
int n;
cin >> n;
DeviceCounter counter;
for (int i = 0; i < n; i++) {
++counter; // must use overloaded prefix operator
}
cout << "Final count=" << counter.getCount();
return 0;
}