#K44317. Complete Book Collection
Complete Book Collection
Complete Book Collection
You are given a string that is a concatenation of book codes. Each book code is exactly 5 characters long and follows the format \(BC\) followed by a three-digit number (with leading zeros if necessary). The full collection consists of 1000 unique codes ranging from \(BC000\) to \(BC999\).
Your task is to determine whether the provided string contains any duplicate book codes. If duplicates are found, output \(-1\). Otherwise, compute and output the number of missing book codes needed to complete the collection.
inputFormat
The input is read from standard input (stdin) and consists of a single string containing concatenated book codes. The length of the string is guaranteed to be a multiple of 5.
outputFormat
Output a single integer to standard output (stdout). If any duplicate codes are detected, output \(-1\); otherwise, output the number of book codes missing to complete the set of 1000 codes.
## sampleBC001BC002BC003BC004
996