Var p, i, t : integer; begin p := 1; i := 1; repeat read (t); if t mod 17 <> 0 then p := p * t; i := i + 1; until i > 17; write (p); end.