Rothes defeat Formartine to reach cup final