Hello @Moussa
Here's how we go about estimating the number of rules based on the given number of inputs and the number of membership functions (MFs) for each input. Ideally, you'd also want to generate 81 MFs for the output. Nevertheless, there's flexibility to reuse certain MFs for specific rules, depending on the situation as perceived by the human designer.
nInput = 4; % number of Inputs
nMFcns = 3; % number of MFs
nRules = nMFcns^nInput % number of Rules