------
## 最终结论
```python
def minFallingPathSum(A):
    n = len(A)
    dp = [[0] * n for _ in range(n)]
    
    # Initialize the first row of dp with the first row of A
    for j in range(n):
        dp[0][j] = A[0][j]
    
    # Fill the dp array from the second row onwards
    for i in range(1, n):
        for j in range(n):
            # Calculate the minimum path sum to reach dp[i][j]
            min_prev = dp[i-1][j]  # directly above
            if j > 0:
                min_prev = min(min_prev, dp[i-1][j-1])  # top-left diagonal
            if j < n - 1:
                min_prev = min(min_prev, dp[i-1][j+1])  # top-right diagonal
            
            dp[i][j] = A[i][j] + min_prev
    
    # Calculate the minimum falling path sum from the last row of dp
    return min(dp[-1])
```