#include using namespace std; typedef long long ll; #define loop(i,a,b) for(i=a;i=b;i--) #define vi vector #define vl vector #define vii vector< vector > #define vll vector< vector > #define vs vector const int inf=1000000001; const ll INF=1e16; #define MOD 1000000007 #define mod 1000000009 #define pi 3.14159265358979323846 int main(){ string n; int i; cin>>n; int sum1=0; loop(i,0,n.size()){ if(n[i]=='0'||n[i]=='4'||n[i]=='6'||n[i]=='9'){ sum1+=3; }else if(n[i]=='8'){ sum1+=4; }else{ sum1+=2; } } sum1++; int sum2=0; sum2++; loop(i,0,n.size()){ if(n[i]=='0'||n[i]=='4'||n[i]=='6'||n[i]=='9'){ sum2+=3; }else if(n[i]=='8'){ sum2+=4; }else{ sum2+=1; } } sum2++; cout<