# -*- coding: utf-8 -*- """ No.542 1円玉と5円玉 https://yukicoder.me/problems/no/542 """ import sys from sys import stdin input = stdin.readline def main(): A, B = map(int, input().split()) dp = [False] * (A + B*5 + 1) for i in range(A+1): dp[i] = True for j in range(1, B+1): for k in range(len(dp)): if dp[k]: if k + 5*j < len(dp): dp[k + 5*j] = True for i in range(1, len(dp)): if dp[i]: print(i) if __name__ == '__main__': main()