#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"i,o,t,j,l,s,z=map(int,input().split())\n"
"a=(i//2+j//2+l//2)*2\n"
"print([a,max(a,((i-1)//2+(j-1)//2+(l-1)//2)*2+3)][not(not(i and j and l))]+o)\n"
"\"";
  system(s);
  return 0;
}            