var a, b, c: integer;
begin
Read(a, b, c);
Write(Ord(a mod 7 = 0) + Ord(b mod 7 = 0) + Ord(c mod 7 = 0) = 2)
end.
var a, b, c: integer;
begin
Read(a, b, c);
Write(Ord(a mod 7 = 0) + Ord(b mod 7 = 0) + Ord(c mod 7 = 0) = 2)
end.