Foot cramps and swimming

I have been swimming for about 4 months. Swim for 40 minutes. Generally water is 80-84 degrees.

My problem is I get foot cramps. Not every time. Some times one foot, sometimes the other. Occasionally both. Stretching out helps a bit to get rid of it. But not always. Occasionally just have to give up on that swim.

I tend to be a toe pointer. If I am sitting flat on the ground, my toes automatically point so that they toes almost touch the ground. Not sure if that has any bearings on the cramps at all.

I drink my 8 plus glasses of water almost every day.

Any recommendations?