#include <iostream>
#include <limits>
int main()
{
    using namespace std;
    
    int n;
    cout << "how many names do you want to register\n";
    cin >> n;

    if (!cin) {
        cin.clear(); // unset the error flag
        cin.ignore( numeric_limits<streamsize>::max(), '\n'); // get rid of the bad input
        cout<<"Please input an integer value\n";
     }

    cin >> n;
    cout << "You've entered " << n << '\n';
}