def calculate_correlation(list1, list2):
    n = min(len(list1), len(list2))
    x = list1[:n]
    y = list2[:n]
    
    mean_x = sum(x) / n
    mean_y = sum(y) / n
    
    numerator = sum((x[i] - mean_x) * (y[i] - mean_y) for i in range(n))
    denominator = (sum((x[i] - mean_x) ** 2 for i in range(n)) * 
                  sum((y[i] - mean_y) ** 2 for i in range(n))) ** 0.5
    
    return numerator / denominator