用Split 和二维数组实现矩阵相乘

问题遇到的背景

我是一个C#初学者,要求写一个实现矩阵相乘的程序,要求必须用Split,不知道该如何找出用户输入矩阵的列数

用代码块功能插入代码,请勿粘贴截图

Console.WriteLine("Please input m:");
string a1 = Console.ReadLine();//输入字符串表示的矩阵
string[] b1 = a1.Split(new char[] { ';'});//行数
string[] d1= a1.Split (new char[] { ','});//逗号个数加1
string[] e1 = a1.Split(new char[] { ';', ',' }); //总数
int N1=((d1.Length-1)/b1.Length)+1;//这个是计算列数的,但是错误的
int[,] m = new int[b1.Length, N1];
int k1 = 0;
for (int i = 0; i < m.GetLength(0); i++)
{
for (int j = 0; j < m.GetLength(1); j++)
{
m[i, j] = Convert.ToInt32(e1[k1]);
k1++;
}
}

        Console.WriteLine("Please input n:");
        string a2 = Console.ReadLine();
        string[] b2 = a2.Split(new char[] { ';' });
        string[] d2 = a2.Split(new char[] { ',' });
        string[] e2 = a1.Split(new char[] { ';', ',' }); 
        int N2=((d2.Length-1)/b2.Length)+1;
        int[,] n = new int[b2.Length, N2];            
        int k2 = 0;
        for (int i = 0; i < n.GetLength(0); i++)
        {
            for (int j = 0; j < n.GetLength(1); j++)
            {                    
                n[i, j] = Convert.ToInt32(e2[k2]);
                k2++;
            }  
        }
        int[,] c = new int[4, 2];//8个数
        for(int i = 0; i < 4; i++)
        {
            for(int j = 0; j < 2; j++)
            {
                for(int k = 0; k <3; k++)
                {
                    c[i, j]+= m[i, k] * n[k, j];
                }
            }
        }
        Console.WriteLine("The result of m*n:");
        if (m.GetLength(1) != n.GetLength(0))
        {
            Console.WriteLine("Illegal operation!");
        }
        else
        {
            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 2; j++)
                {
                    Console.Write(" {0}", c[i, j]);

                }
            }
        }          
        Console.ReadKey();
运行结果及报错内容

输出结果是错误的

我的解答思路和尝试过的方法
我想要达到的结果【样例输入】

输出的结果应如下:
Please input m:
5,2,4;3,8,2;6,0,4;0,1,6
Please input n:
2,4;1,3;3,2

【样例输出】
The result of m*n:
24 34
20 40
24 32
19 15


Console.WriteLine("Please input m:");
string a1 = Console.ReadLine();//输入字符串表示的矩阵
string[] b1 = a1.Split(';');//行数
string[] d1 = b1[0].Split(',');//逗号个数加1
//string[] e1 = a1.Split(';', ','); //总数
int N1 = d1.Length;//这个是计算列数的,但是错误的
int[,] m = new int[b1.Length, N1];
int k1 = 0;

for (int i = 0; i < b1.Length; i++)
{
    d1 = b1[i].Split(',');
    for (int j = 0; j < d1.Length; j++)
    {
        m[i, j] = Convert.ToInt32(d1[j]);
    }

}

for (int i = 0; i < m.GetLength(0); i++)
{
    for (int j = 0; j < m.GetLength(1); j++)
    {
        Console.Write(m[i, j] + " ");
    }
    Console.WriteLine();
}