#include <iostream>
#include <regex>
#include <string>
#include <experimental/optional>

std::experimental::optional<int> find_int_regex( const std::string & s )
{
	static const std::regex r( "(\\d+)" );
	std::smatch match;
	if( std::regex_search( s.begin(), s.end(), match, r ) )
	{
		return std::stoi( match[1] );
	}
    return {};
}

int main()
{
	for( std::string line; std::getline( std::cin, line ); )
	{
		auto n = find_int_regex( line );
		if( n )
		{
			std::cout << "Got " << n.value() << " in " << line << std::endl;
		}
	}
	return 0;
}
