one $4$-cycle, we define

$$f(G) = \sum_{C=u_1,u_2,u_3,u_4,u_1 \in C_4(G)} (\deg(u_1) + \deg(u_2)+ \deg(u_3)+ \deg(u_4) - 8).$$ Otherwise, $f(G)=0.$

It is easy to notice that $f(G)$ is exactly the number of ordered pairs $(C,e)$, where $C$ is a cycle of $G$ and $e$ exits $C$. Now we are able to state the main result of the paper. In the proof, vertices $u,v$ of a 6-cycle $C$ are called *diametrically opposite* if $d_C(u,v)=3$.

\[glavni\] Let $G$ be a connected graph without $3$-cycles. Moreover, suppose that any two distinct cycles $C_1,C_2 \in C_4(G) \cup C_5(G) \cup C_6(G)$ have at most two common edges and any two cycles $C_1,C_2 \in C_4(G)$ have at most one common edge. Then it holds $$W_p(G) = M_2(G) - M_1(G) - f(G) - 4|C_4(G)| - 5|C_5(G)| - 3|C_6(G)| + |E(G)|.$$

If $G$ is a star graph or a graph with only one vertex, it can be easily checked that the theorem holds. Therefore, in the rest of the proof we assume that $G$ has more than one vertex and that $G$ is not a star graph. Let $e=xy \in E(G)$ be an edge with $\deg(x) > 1$ and $\deg(y)>1$. Moreover, let $u,v \in V(G) \setminus \lbrace x,y \rbrace$ be 