Number Increase if value same

So i want a feature that if the new entry is same to earlier enter then set the new entry to 1

eg -

old entry :-

new entry :-
MM1240424 or MM2404241

Thank You

help if this works in mit app inventor

Please ask on the community of your builder