Details

Solve this problem and put the problem solution code at the top of your cover letter note.



Problem

Assume you have the protein sequence attached below. It's composed of 800 amino acids.

Can you find the length of the shortest substring (biological subsequence) that needs to be replaced in order to have all the amino acids equally represented? That means same numbers of "A", "C", "D" and so on.

Input the length of the sequence that you found into the "Answer" field to go to the next stage.

NB: Make your code as efficient as you can, you might be asked to explain your solution if you are selected for an interview.

Input

ITAGDKIWAIIAGDPEILDRAVQMISPDHDELRVAVPLGFNNLPAHSTIEVYVLEKITLTLMFRGLGVTKPLQTRGAAGRGLITDSYKTAEIIVSRAVGYTITKSGKHPPGSPQIACFMKNMRFQKARTHVLGSALNDGFFIDLAADIKALVEPQVAPCSTAKQASRLSAPEKSPTTQTPTGRGLIQAIRVPERVKLQLTIVVVVGGAPYPTCTSTAGGLAAFRALVIMSVPGLVVLSISKCTQGPKGIANDPSLTYKPAGAERGKIVHGSLWVSLRIKTGAANEKVWEVWGIMAAQPITSEKTIMQQIKRVPLAGLQSLVLVGTSIVDIGVSYYALLMGKLTVEENQTELVFAEAPSLQLIDFDVRHIYRATIDGVFMGGVDIKDGGMEELPDPKTKAGLSAKDNVARALMECTNDVSPYSDIQIPLRSDSLAAYADLKISLETIRAHYNIGVGVALARELSLYNFLAKAGLEKEVQNTMTEQFVHLYESRKNDLYKLVRDYGSLEIPEKGYLVVYMQDAAPLDGSRANMMIPGGGTINVSQRLVSIVAYCNSYALAPNSAAVGALGVANIQNLSLLNLHLIEGKIGEYKQLVLYTGQTLTQAKKMVERFYASQSDLVEAIFIGAQYSIVLFYPPLQGKPFRWPFISCEELASPPNHCHTRSRYLVGLAYYVSQNSPAHTDEFVFEPKDKYFVIALELCSMKSITALRKTDMMYLDVKHQLSNFEDSIGLVLPLSFTHFNAVMHLGKRVSRIATIRAHALEFGDIAFISSAQPFDWAGKSAKFSAPDKQLPYRELSANR

Answer