#include <algorithm>
#include <iostream>
#include <set>
#include <string>
int main()
{
std::string str1 = "just string with some numbers 124632";
std::string str2 = "1234567890 i";
std::set<std::string::value_type> setOfSymbolsInStr1(
str1.begin(),
str1.end());
std::set<std::string::value_type> setOfSymbolsInStr2(
str2.begin(),
str2.end());
std::set<std::string::value_type> intersection;
std::set_intersection(
setOfSymbolsInStr1.begin(),
setOfSymbolsInStr1.end(),
setOfSymbolsInStr2.begin(),
setOfSymbolsInStr2.end(),
std::inserter(intersection, intersection.begin()));
std::cout << intersection.size() << std::endl;
return 0;
}