Java solution
\nclass Solution {\n    public int longestBeautifulSubstring(String word) {\n        \n        int maxCount = 0, currCount = 1, vowCount = 1;\n        \n       
```\nclass Solution {\n    public int longestBeautifulSubstring(String word) {\n        \n        int maxCount = 0, currCount = 1, vowCount = 1;\n        \n        for (int i = 1; i < word.length(); i++) {\n            char prev = word.charAt(i-1);\n            char curr = word.charAt(i);\n            if (curr < prev) {\n                currCount = 1;\n                vowCount = 1;\n            } else if (curr > prev) {\n                vowCount++;\n                currCount++;\n            } else {\n                currCount++;\n            }\n            if (vowCount == 5) {\n                maxCount = Integer.max(currCount, maxCount); \n            }\n        }\n        return maxCount;\n    }\n}\n```
['Java']