I searched for it and found the link C# EPPlus OpenXML count rows
int iRowCount = currentWorksheet.Dimension.End.Row - currentWorksheet.Dimension.Start.Row;
Another way to do it.
var lastRow = sheet.Cells.Where(cell => !string.IsNullOrEmpty(cell.Value?.ToString() ?? string.Empty)).LastOrDefault().End.Row;