count text string in multiple cells

In roughly 3500 rows, I have a series of alphanumeric sequences; each row is between 19 and 23 cells (columns) wide.

I am looking for 4 exact matches to character pairings at the third and fourth character positions in each cell, to be reported in 4 cells located elsewhere in that row.

Simplified Example:
A1 = C9AZ6200M
B1 = C9AT6200R
C1 = D0ZM1510X
D1 = DAQR1510ZM
E1 = D1ZM9C483P
F1 = A2AT1210R
G1 = B9AZ12ZM109C
H1 = ZMZM6049ZM
I1 = EDZM9954X
J1 = ZMAT9401B

Problem:

  1. Count the cells in $A01:$A10 containing the string “ZM” only in the third and forth character positions in each cell.
    [unless I have miscounted manually, the answer is 4; this value appears in cell L1]

=====================
LibreOffice Version 5.1.6.2

Either

=SUM(MID(A1:J1;3;2)="ZM")

entered as array formula (closed with Shift+Ctrl+Enter instead of just Enter), or

=SUMPRODUCT(MID(A1:J1;3;2)="ZM")

where SUMPRODUCT() forces the arguments to array context.

Btw, LibreOffice 5.1.6 is years old, it’s advisable to upgrade to a recent release.