using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var p = NList; var (c, y) = (p[0], p[1]); var c500 = y / 500; var c100 = y / 100 % 5; var change = (Math.Max(0, c - c100) + 4) / 5; if (c500 < change) WriteLine("can't exchange"); else if (change == 0) WriteLine("no exchange"); else WriteLine(change * 5 + c100); } }