The maximum value that cannot be expressed as a sum of non-negative multiples of a and b is
if a and b are relatively prime.
For relatively prime positive integers a,b, there are exactly
2(a−1)(b−1)
positive integers which cannot be expressed in the form ma+nb, where m and n are non-negative integers.
Correction
The book's second sentence says "where m and n are positive integers"; the count 2(a−1)(b−1) is for non-negative m,n. (With a=3, b=5: 1,2,4,7 are the 4 unreachable numbers, but with positive m,n the numbers 3,5,6,9,10 would be unreachable too.)