#!/bin/python
# -*- coding: utf8 -*-
import sys
import os
import re
#请完成下面这个函数,实现题目要求的功能
#当然,你也可以不按照下面这个模板来作答,完全按照自己的想法来 ^-^
#******************************开始写代码******************************
def check(s,dis):
val = {}
for i in range(len(s)):
if s[i] not in val:
val[s[i]]=dis[i]
elif val[s[i]]==dis[i]:
continue
else:
return 0
return 1
def solve(S, T):
if(len(S)>len(T)):
s1 = str(S)
s2 = str(T)
else:
s1 = str(T)
s2 = str(S)
count = 0
for i in range(len(s1)-len(s2)+1):
dis = []
for j in range(len(s2)):
dis.append(ord(s2[j])-ord(s1[i+j]))
if(check(s2,dis)):
count = count + 1
return count
#******************************结束写代码******************************
try:
_S = 'ababcb'#raw_input()
except:
_S = None
try:
_T = 'xyx'#raw_input()
except:
_T = None
res = solve(_S, _T)
print str(res) + "\n"