#include <iostream>

unsigned a[]={1,2,5};

unsigned ret(unsigned ard){
  switch(ard){
    case 0: return 0;break;
    case 1: return 1;break;
    case 2: return 1;break;
    case 3: return 2;break;
    case 4: return 2;break;
    case 5: return 1;break;
    case 6: return 2;break;
    case 7: return 2;break;
    case 8: return 3;break;
    case 9: return 3;break;
  }
  return 0;
}

int main(){
  long long unsigned n,c=0;
  std::cin>>n;
  while(n!=0){
    c+=ret(n%10);
    n/=10;
  }
  std::cout<<c;
}