#include #include #include #include using namespace std; #define cerr cerr << "[DBG] " #define DBG(x) cerr << #x << ": " << x << endl // http://genkisugimoto.com/jp/blog/procon/2015/04/15/print-debug-technique-in-cpp.html template ostream& operator<<(ostream& s, const pair& p) {return s << "(" << p.first << ", " << p.second << ")";} template ostream& operator<<(ostream& s, const vector& v) { for (int i = 0; i < v.size(); ++i) { s << v[i]; if (i < v.size() - 1) s << "\t"; } return s; } typedef long long ll; typedef unsigned long long ull; const ull B=100000007; // 蟻本p332写経 int count(string s, string c){ int result = 0; int sl = s.length(); int cl = c.length(); if(cl > sl) return 0; // t=B^cl ull t = 1; for(int i=0; i> s; int m; cin >> m; ll result = 0; for(int i=0; i> c; result += count(s, c); } cout << result << endl; return 0; }